Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(docs): generate comprehensive toolkit list for /toolkits.md
The /toolkits.md endpoint was returning empty content because the index MDX page only contains a React component that gets stripped. This adds special handling to generate a comprehensive markdown table listing all 864 toolkits with their slug, tool count, trigger count, and auth methods. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sushmithamallesh committed
Jan 28, 2026 at 00:43 UTC
7b95c3ad5c4be30388b599be303d228d2ab5579b
1 file changed
+54
docs/app/llms.mdx/[[...slug]]/route.ts
+54
@@ -422,6 +422,50 @@ async function getToolkit(slug: string): Promise<Toolkit | null> {
422
}
423
}
424
425
+async function getAllToolkits(): Promise<Toolkit[]> {
426
+ try {
427
+ const filePath = join(process.cwd(), 'public/data/toolkits.json');
428
+ const data = await readFile(filePath, 'utf-8');
429
+ return JSON.parse(data) as Toolkit[];
430
+ } catch {
431
+ return [];
432
+ }
433
+}
434
+
435
+// Generate a comprehensive toolkits index for /toolkits.md
436
+async function generateToolkitsIndex(): Promise<string> {
437
+ const toolkits = await getAllToolkits();
438
+
439
+ // Sort alphabetically by name
440
+ const sorted = [...toolkits].sort((a, b) =>
441
+ (a.name?.trim() || '').localeCompare(b.name?.trim() || '')
442
+ );
443
+
444
+ const lines: string[] = [
445
+ '# Toolkits',
446
+ '',
447
+ `Composio supports ${toolkits.length} toolkits for building AI agents.`,
448
+ '',
449
+ '## All Toolkits',
450
+ '',
451
+ '| Toolkit | Slug | Tools | Triggers | Auth |',
452
+ '|---------|------|-------|----------|------|',
453
+ ];
454
+
455
+ for (const toolkit of sorted) {
456
+ const name = toolkit.name?.trim() || toolkit.slug;
457
+ const auth = toolkit.authSchemes?.join(', ') || 'None';
458
+ lines.push(
459
+ `| [${name}](/toolkits/${toolkit.slug}.md) | \`${toolkit.slug.toUpperCase()}\` | ${toolkit.toolCount} | ${toolkit.triggerCount} | ${auth} |`
460
+ );
461
+ }
462
+
463
+ lines.push('', '## Toolkit Details', '');
464
+ lines.push('For detailed information about each toolkit including all tools and triggers, visit the individual toolkit pages listed above.');
465
+
466
+ return lines.join('\n');
467
+}
468
+
469
export async function GET(
470
_req: Request,
471
{ params }: { params: Promise<{ slug?: string[] }> }
@@ -430,6 +474,16 @@ export async function GET(
474
const { slug = [] } = await params;
475
const [prefix, ...rest] = slug;
476
477
+ // Special handling for toolkits index - generate comprehensive list
478
+ if (prefix === 'toolkits' && rest.length === 0) {
479
+ const toolkitsIndex = await generateToolkitsIndex();
480
+ return new Response(toolkitsIndex, {
481
+ headers: {
482
+ 'Content-Type': 'text/markdown; charset=utf-8',
483
+ },
484
+ });
485
+ }
486
+
487
// Handle 'reference' specially - uses async getReferenceSource() for OpenAPI pages
488
// eslint-disable-next-line @typescript-eslint/no-explicit-any
489
let pageSource: any;