@devries-cameron20 / composio Mirror · read-only / commits / 9706a1575
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 18:15 UTC

docs: fix toolkit generation (#2149)

Rahul Tarak committed Nov 4, 2025 at 16:56 UTC 9706a157581630a746fcc4b9697588052e4fecd8
12 files changed +55 -50
.github/workflows/check_broken_links.yml
+2 -2
@@ -16,7 +16,7 @@ jobs:
16 image: ghcr.io/composiohq/dev-base:latest
17 permissions: read-all
18 env:
19 - COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY_PROD }}
19 + COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY }}
20
21 steps:
22 - name: Checkout repository
@@ -66,4 +66,4 @@ jobs:
66 exit 1
67 else
68 echo "✅ No broken links found"
69 - fi
\ No newline at end of file
69 + fi
.github/workflows/preview_docs.yml
+12 -2
@@ -12,7 +12,7 @@ jobs:
12 image: ghcr.io/composiohq/dev-base:latest
13 permissions: write-all
14 env:
15 - COMPOSIO_API_KEY: ${{ inputs.api_key || secrets.COMPOSIO_API_KEY_PROD }}
15 + COMPOSIO_API_KEY: ${{ inputs.api_key || secrets.COMPOSIO_API_KEY }}
16
17 steps:
18 - name: Checkout repository
@@ -40,8 +40,18 @@ jobs:
40 env:
41 FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
42 POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
43 + shell: bash
44 run: |
44 - URL=$(pnpm turbo run preview | grep -oP 'Published docs to \K.*(?= \()')
45 + set -o pipefail
46 + pnpm turbo run preview | tee preview.log
47 +
48 + URL=$(grep -oP 'Published docs to \K.*(?= \()' preview.log | tail -n 1 || true)
49 +
50 + if [ -z "$URL" ]; then
51 + echo "::error::Failed to extract preview URL from preview.log"
52 + exit 1
53 + fi
54 +
55 echo "Preview URL: $URL"
56 echo "Preview your docs: $URL" > preview_url.txt
57
.github/workflows/publish_docs.yml
+1 -1
@@ -22,7 +22,7 @@ jobs:
22 if: ${{ (github.event_name == 'push' && contains(github.ref, 'refs/heads/next') && github.run_number > 1) || github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' }}
23 permissions: write-all
24 env:
25 - COMPOSIO_API_KEY: ${{ inputs.api_key || secrets.COMPOSIO_API_KEY_PROD }}
25 + COMPOSIO_API_KEY: ${{ inputs.api_key || secrets.COMPOSIO_API_KEY }}
26 steps:
27 - name: Checkout repository
28 uses: actions/checkout@v4
.github/workflows/py.test.yml
+1 -1
@@ -176,7 +176,7 @@ jobs:
176 runs-on: ubuntu-22.04 # Use Ubuntu 22.04 for stability
177 permissions: read-all
178 env:
179 - COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY_PROD }}
179 + COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY }}
180
181 steps:
182 - name: Checkout repository
fern/pages/src/mcp/providers.mdx
+1
@@ -1,5 +1,6 @@
1 ---
2 title: Provider integrations
3 +image: "https://og.composio.dev/api/og?title=Provider%20integrations" # image for socials
4 subtitle: Connect MCP servers to AI frameworks
5 ---
6
fern/pages/src/mcp/quickstart.mdx
+1
@@ -1,5 +1,6 @@
1 ---
2 title: MCP quickstart
3 +image: "https://og.composio.dev/api/og?title=MCP%20quickstart" # image for socials
4 subtitle: Create your first MCP server
5 ---
6 [Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP) is an open-source standard for connecting AI applications to external tools. All the 500+ tools available in Composio are also available as MCP servers.
fern/pages/src/mcp/server-management.mdx
+1
@@ -1,5 +1,6 @@
1 ---
2 title: Server management
3 +image: "https://og.composio.dev/api/og?title=Server%20management" # image for socials
4 subtitle: Create, update, and manage MCP servers
5 ---
6
fern/scripts/add_og_imgs.py
+5 -13
@@ -90,19 +90,11 @@ def update_mdx_image(file_path, dry_run=False, verbose=False):
90 image_match = re.search(image_pattern, frontmatter, re.MULTILINE)
91
92 if image_match:
93 - # Check if it's already the correct URL
94 - current_image_line = image_match.group(0)
95 - if image_url in current_image_line:
96 - return {"updated": False, "message": "Image URL already up to date", "title": title}
97 -
98 - # Update existing image property
99 - new_frontmatter = re.sub(
100 - image_pattern,
101 - f"image: {image_url} # image for socials",
102 - frontmatter,
103 - flags=re.MULTILINE,
104 - )
105 - action = "Updated existing"
93 + return {
94 + "updated": False,
95 + "message": "Image property already present, skipping",
96 + "title": title,
97 + }
98 else:
99 # Add image property after title
100 title_pattern = r"^title:\s*.*$"
fern/scripts/build-llms-txt.ts
+10 -10
@@ -18,7 +18,7 @@ const TOOLS_JSON_PATH = path.join(
18 'tools.json'
19 );
20 const PAGES_DIR = path.join(FERN_DIR, 'pages');
21 -const TOOLS_DIR = path.join(FERN_DIR, 'tools');
21 +const TOOLKITS_DIR = path.join(FERN_DIR, 'toolkits');
22
23 interface DocsConfig {
24 title: string;
@@ -70,7 +70,7 @@ interface ToolsData {
70 // Parse tool MDX files to extract toolkit information
71 function parseToolMdx(toolMdxPath: string): ToolkitInfo | null {
72 try {
73 - const fullPath = path.join(TOOLS_DIR, toolMdxPath);
73 + const fullPath = path.join(TOOLKITS_DIR, toolMdxPath);
74 if (!fs.existsSync(fullPath)) {
75 console.warn(`⚠️ Tool file not found: ${fullPath}`);
76 return null;
@@ -224,10 +224,10 @@ function processContentItems(
224 ): void {
225 for (const item of items) {
226 if (item.page && item.path) {
227 - // Check if this is a tool page (in tools/ directory) with a SLUG
228 - if (item.path.includes('tools/') && item.path.endsWith('.mdx')) {
227 + // Check if this is a tool page (in toolkits/ directory) with a SLUG
228 + if (item.path.includes('toolkits/') && item.path.endsWith('.mdx')) {
229 // Parse tool MDX file and check if it has a SLUG (actual tool page)
230 - const toolMdxFile = item.path.match(/tools\/(.+\.mdx)$/)?.[1];
230 + const toolMdxFile = item.path.match(/toolkits\/(.+\.mdx)$/)?.[1];
231 if (toolMdxFile) {
232 const toolkitInfo = parseToolMdx(toolMdxFile);
233 if (toolkitInfo) {
@@ -236,7 +236,7 @@ function processContentItems(
236 toolsData[toolkitInfo.slug] = toolkitInfo;
237 continue;
238 }
239 - // If no SLUG found, it's a documentation page in tools/ - include in main entries
239 + // If no SLUG found, it's a documentation page in toolkits/ - include in main entries
240 }
241 }
242
@@ -414,10 +414,10 @@ function startWatchMode(): void {
414 }
415 });
416
417 - // Watch MDX files in tools directory
418 - const toolsWatcher = watch(TOOLS_DIR, { recursive: true }, async (eventType, filename) => {
417 + // Watch MDX files in toolkits directory
418 + const toolkitsWatcher = watch(TOOLKITS_DIR, { recursive: true }, async (eventType, filename) => {
419 if (filename && (filename.endsWith('.mdx') || filename.endsWith('.md'))) {
420 - console.log(`🔄 Tool doc changed: ${filename}, rebuilding...`);
420 + console.log(`🔄 Toolkit doc changed: ${filename}, rebuilding...`);
421 await buildLlmsTxt();
422 }
423 });
@@ -427,7 +427,7 @@ function startWatchMode(): void {
427 console.log('\n👋 Stopping watchers...');
428 docsWatcher.close();
429 pagesWatcher.close();
430 - toolsWatcher.close();
430 + toolkitsWatcher.close();
431 process.exit(0);
432 });
433 }
fern/scripts/manage-tool-docs.py
+16 -16
@@ -29,20 +29,20 @@ def process_tool_docs(file_path: Path, action: str) -> None:
29 content = f.read()
30
31 if action == 'uncomment':
32 - # First, uncomment any commented lines in the tools section
32 + # First, uncomment any commented lines in the toolkits section
33 lines = content.split('\n')
34 new_lines = []
35 in_tools_section = False
36
37 for i, line in enumerate(lines):
38 - # Check if we're entering the tools tab
39 - if '- tab: tools' in line:
38 + # Check if we're entering the toolkits tab
39 + if '- tab: toolkits' in line:
40 in_tools_section = True
41 - # Check if we're leaving the tools tab
41 + # Check if we're leaving the toolkits tab
42 elif in_tools_section and line.strip().startswith('- tab:'):
43 in_tools_section = False
44
45 - # Uncomment lines in tools section
45 + # Uncomment lines in toolkits section
46 if in_tools_section and line.strip().startswith('#') and ('- page:' in line or 'path:' in line):
47 # Remove comment while preserving indentation
48 uncommented = line.replace('# ', '', 1) if '# ' in line else line.replace('#', '', 1)
@@ -60,30 +60,30 @@ def process_tool_docs(file_path: Path, action: str) -> None:
60 print("Error: No navigation section found in docs.yml")
61 return
62
63 - # Find the tools tab
63 + # Find the toolkits tab
64 tools_tab = None
65 for tab in data['navigation']:
66 - if isinstance(tab, CommentedMap) and tab.get('tab') == 'tools':
66 + if isinstance(tab, CommentedMap) and tab.get('tab') == 'toolkits':
67 tools_tab = tab
68 break
69
70 if not tools_tab:
71 - print("Error: No tools tab found in navigation")
71 + print("Error: No toolkits tab found in navigation")
72 return
73
74 - # Find the tools section within the tools tab
74 + # Find the toolkits section within the toolkits tab
75 if 'layout' not in tools_tab:
76 - print("Error: No layout found in tools tab")
76 + print("Error: No layout found in toolkits tab")
77 return
78
79 tools_section = None
80 for section in tools_tab['layout']:
81 - if isinstance(section, CommentedMap) and section.get('section') == 'Tools':
81 + if isinstance(section, CommentedMap) and section.get('section') == 'Toolkits':
82 tools_section = section
83 break
84
85 if not tools_section or 'contents' not in tools_section:
86 - print("Error: No contents found in Tools section")
86 + print("Error: No contents found in Toolkits section")
87 return
88
89 if action == 'comment':
@@ -92,7 +92,7 @@ def process_tool_docs(file_path: Path, action: str) -> None:
92 yaml.dump(data, stream)
93 content = stream.getvalue()
94
95 - # Now manually comment out tools after the 1st one (introduction)
95 + # Now manually comment out toolkits after the 1st one (introduction)
96 lines = content.split('\n')
97 new_lines = []
98 in_tools_section = False
@@ -102,8 +102,8 @@ def process_tool_docs(file_path: Path, action: str) -> None:
102 while i < len(lines):
103 line = lines[i]
104
105 - # Check if we're entering the tools section
106 - if '- section: Tools' in line and 'tools' in '\n'.join(lines[max(0, i-10):i]):
105 + # Check if we're entering the toolkits section
106 + if '- section: Toolkits' in line and 'toolkits' in '\n'.join(lines[max(0, i-10):i]):
107 in_tools_section = True
108 new_lines.append(line)
109 i += 1
@@ -182,4 +182,4 @@ def main():
182
183
184 if __name__ == '__main__':
185 - exit(main())
\ No newline at end of file
185 + exit(main())
fern/turbo.json
+4 -4
@@ -4,7 +4,7 @@
4 "tasks": {
5 "build": {
6 "dependsOn": ["api:pull", "add-og", "snippets:build", "tools:generate", "sdkdocs"],
7 - "outputs": ["apis/openapi.json", "apis/openapi-mcp.json", "pages/dist/**", "tools/**"],
7 + "outputs": ["apis/openapi.json", "apis/openapi-mcp.json", "pages/dist/**", "toolkits/**"],
8 "cache": true
9 },
10
@@ -48,7 +48,7 @@
48 },
49
50 "tools:generate": {
51 - "outputs": ["tools/**"],
51 + "outputs": ["toolkits/**"],
52 "inputs": ["generators/tool_doc_generator/**/*.py", "generators/tool_doc_generator/templates/**/*"],
53 "cache": true,
54 "env": ["COMPOSIO_API_KEY"]
@@ -82,7 +82,7 @@
82 "llms:build": {
83 "dependsOn": ["build"],
84 "outputs": ["llms-txt/public/llms.txt"],
85 - "inputs": ["docs.yml", "pages/**/*.mdx", "pages/**/*.md", "tools/**/*.mdx", "scripts/build-llms-txt.ts"],
85 + "inputs": ["docs.yml", "pages/**/*.mdx", "pages/**/*.md", "toolkits/**/*.mdx", "scripts/build-llms-txt.ts"],
86 "cache": true
87 },
88
@@ -129,4 +129,4 @@
129 "cache": true
130 }
131 }
132 -}
\ No newline at end of file
132 +}
ts/packages/core/src/models/Tools.ts
+1 -1
@@ -108,7 +108,7 @@ export class Tools<
108 inputParameters: tool.input_parameters,
109 outputParameters: tool.output_parameters,
110 availableVersions: tool.available_versions,
111 - isDeprecated: tool.is_deprecated,
111 + isDeprecated: tool.deprecated?.is_deprecated ?? false,
112 isNoAuth: tool.no_auth,
113 });
114 }