Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
docs: fix toolkit generation (#2149)
Rahul Tarak9706a1575816
diff --git a/.github/workflows/check_broken_links.yml b/.github/workflows/check_broken_links.ymlindex 06d825a2b..2737952a9 100644--- a/.github/workflows/check_broken_links.yml+++ b/.github/workflows/check_broken_links.yml@@ -16,7 +16,7 @@ jobs:image: ghcr.io/composiohq/dev-base:latestpermissions: read-allenv:- COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY_PROD }}+ COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY }}steps:- name: Checkout repository@@ -66,4 +66,4 @@ jobs:exit 1elseecho "✅ No broken links found"- fi\ No newline at end of file+ fidiff --git a/.github/workflows/preview_docs.yml b/.github/workflows/preview_docs.ymlindex 3f416a550..ed5bf706a 100644--- a/.github/workflows/preview_docs.yml+++ b/.github/workflows/preview_docs.yml@@ -12,7 +12,7 @@ jobs:image: ghcr.io/composiohq/dev-base:latestpermissions: write-allenv:- COMPOSIO_API_KEY: ${{ inputs.api_key || secrets.COMPOSIO_API_KEY_PROD }}+ COMPOSIO_API_KEY: ${{ inputs.api_key || secrets.COMPOSIO_API_KEY }}steps:- name: Checkout repository@@ -40,8 +40,18 @@ jobs:env:FERN_TOKEN: ${{ secrets.FERN_TOKEN }}POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}+ shell: bashrun: |- URL=$(pnpm turbo run preview | grep -oP 'Published docs to \K.*(?= \()')+ set -o pipefail+ pnpm turbo run preview | tee preview.log++ URL=$(grep -oP 'Published docs to \K.*(?= \()' preview.log | tail -n 1 || true)++ if [ -z "$URL" ]; then+ echo "::error::Failed to extract preview URL from preview.log"+ exit 1+ fi+echo "Preview URL: $URL"echo "Preview your docs: $URL" > preview_url.txtdiff --git a/.github/workflows/publish_docs.yml b/.github/workflows/publish_docs.ymlindex 2b60b440c..8bc800d38 100644--- a/.github/workflows/publish_docs.yml+++ b/.github/workflows/publish_docs.yml@@ -22,7 +22,7 @@ jobs: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' }}permissions: write-allenv:- COMPOSIO_API_KEY: ${{ inputs.api_key || secrets.COMPOSIO_API_KEY_PROD }}+ COMPOSIO_API_KEY: ${{ inputs.api_key || secrets.COMPOSIO_API_KEY }}steps:- name: Checkout repositoryuses: actions/checkout@v4diff --git a/.github/workflows/py.test.yml b/.github/workflows/py.test.ymlindex 072d70680..453897c0a 100644--- a/.github/workflows/py.test.yml+++ b/.github/workflows/py.test.yml@@ -176,7 +176,7 @@ jobs:runs-on: ubuntu-22.04 # Use Ubuntu 22.04 for stabilitypermissions: read-allenv:- COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY_PROD }}+ COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY }}steps:- name: Checkout repositorydiff --git a/fern/pages/src/mcp/providers.mdx b/fern/pages/src/mcp/providers.mdxindex 59f38dac2..eafc70b1d 100644--- a/fern/pages/src/mcp/providers.mdx+++ b/fern/pages/src/mcp/providers.mdx@@ -1,5 +1,6 @@---title: Provider integrations+image: "https://og.composio.dev/api/og?title=Provider%20integrations" # image for socialssubtitle: Connect MCP servers to AI frameworks---diff --git a/fern/pages/src/mcp/quickstart.mdx b/fern/pages/src/mcp/quickstart.mdxindex 1889cbb9f..998f40b0e 100644--- a/fern/pages/src/mcp/quickstart.mdx+++ b/fern/pages/src/mcp/quickstart.mdx@@ -1,5 +1,6 @@---title: MCP quickstart+image: "https://og.composio.dev/api/og?title=MCP%20quickstart" # image for socialssubtitle: Create your first MCP server---[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.diff --git a/fern/pages/src/mcp/server-management.mdx b/fern/pages/src/mcp/server-management.mdxindex 228a313ca..27fbf2a7b 100644--- a/fern/pages/src/mcp/server-management.mdx+++ b/fern/pages/src/mcp/server-management.mdx@@ -1,5 +1,6 @@---title: Server management+image: "https://og.composio.dev/api/og?title=Server%20management" # image for socialssubtitle: Create, update, and manage MCP servers---diff --git a/fern/scripts/add_og_imgs.py b/fern/scripts/add_og_imgs.pyindex e73bacc77..062bcff30 100644--- a/fern/scripts/add_og_imgs.py+++ b/fern/scripts/add_og_imgs.py@@ -90,19 +90,11 @@ def update_mdx_image(file_path, dry_run=False, verbose=False):image_match = re.search(image_pattern, frontmatter, re.MULTILINE)if image_match:- # Check if it's already the correct URL- current_image_line = image_match.group(0)- if image_url in current_image_line:- return {"updated": False, "message": "Image URL already up to date", "title": title}-- # Update existing image property- new_frontmatter = re.sub(- image_pattern,- f"image: {image_url} # image for socials",- frontmatter,- flags=re.MULTILINE,- )- action = "Updated existing"+ return {+ "updated": False,+ "message": "Image property already present, skipping",+ "title": title,+ }else:# Add image property after titletitle_pattern = r"^title:\s*.*$"diff --git a/fern/scripts/build-llms-txt.ts b/fern/scripts/build-llms-txt.tsindex 1db0119c1..fbd726308 100644--- a/fern/scripts/build-llms-txt.ts+++ b/fern/scripts/build-llms-txt.ts@@ -18,7 +18,7 @@ const TOOLS_JSON_PATH = path.join('tools.json');const PAGES_DIR = path.join(FERN_DIR, 'pages');-const TOOLS_DIR = path.join(FERN_DIR, 'tools');+const TOOLKITS_DIR = path.join(FERN_DIR, 'toolkits');interface DocsConfig {title: string;@@ -70,7 +70,7 @@ interface ToolsData {// Parse tool MDX files to extract toolkit informationfunction parseToolMdx(toolMdxPath: string): ToolkitInfo | null {try {- const fullPath = path.join(TOOLS_DIR, toolMdxPath);+ const fullPath = path.join(TOOLKITS_DIR, toolMdxPath);if (!fs.existsSync(fullPath)) {console.warn(`⚠️ Tool file not found: ${fullPath}`);return null;@@ -224,10 +224,10 @@ function processContentItems(): void {for (const item of items) {if (item.page && item.path) {- // Check if this is a tool page (in tools/ directory) with a SLUG- if (item.path.includes('tools/') && item.path.endsWith('.mdx')) {+ // Check if this is a tool page (in toolkits/ directory) with a SLUG+ if (item.path.includes('toolkits/') && item.path.endsWith('.mdx')) {// Parse tool MDX file and check if it has a SLUG (actual tool page)- const toolMdxFile = item.path.match(/tools\/(.+\.mdx)$/)?.[1];+ const toolMdxFile = item.path.match(/toolkits\/(.+\.mdx)$/)?.[1];if (toolMdxFile) {const toolkitInfo = parseToolMdx(toolMdxFile);if (toolkitInfo) {@@ -236,7 +236,7 @@ function processContentItems(toolsData[toolkitInfo.slug] = toolkitInfo;continue;}- // If no SLUG found, it's a documentation page in tools/ - include in main entries+ // If no SLUG found, it's a documentation page in toolkits/ - include in main entries}}@@ -414,10 +414,10 @@ function startWatchMode(): void {}});- // Watch MDX files in tools directory- const toolsWatcher = watch(TOOLS_DIR, { recursive: true }, async (eventType, filename) => {+ // Watch MDX files in toolkits directory+ const toolkitsWatcher = watch(TOOLKITS_DIR, { recursive: true }, async (eventType, filename) => {if (filename && (filename.endsWith('.mdx') || filename.endsWith('.md'))) {- console.log(`🔄 Tool doc changed: ${filename}, rebuilding...`);+ console.log(`🔄 Toolkit doc changed: ${filename}, rebuilding...`);await buildLlmsTxt();}});@@ -427,7 +427,7 @@ function startWatchMode(): void {console.log('\n👋 Stopping watchers...');docsWatcher.close();pagesWatcher.close();- toolsWatcher.close();+ toolkitsWatcher.close();process.exit(0);});}diff --git a/fern/scripts/manage-tool-docs.py b/fern/scripts/manage-tool-docs.pyindex 13d629cfb..c9e59e28d 100755--- a/fern/scripts/manage-tool-docs.py+++ b/fern/scripts/manage-tool-docs.py@@ -29,20 +29,20 @@ def process_tool_docs(file_path: Path, action: str) -> None:content = f.read()if action == 'uncomment':- # First, uncomment any commented lines in the tools section+ # First, uncomment any commented lines in the toolkits sectionlines = content.split('\n')new_lines = []in_tools_section = Falsefor i, line in enumerate(lines):- # Check if we're entering the tools tab- if '- tab: tools' in line:+ # Check if we're entering the toolkits tab+ if '- tab: toolkits' in line:in_tools_section = True- # Check if we're leaving the tools tab+ # Check if we're leaving the toolkits tabelif in_tools_section and line.strip().startswith('- tab:'):in_tools_section = False- # Uncomment lines in tools section+ # Uncomment lines in toolkits sectionif in_tools_section and line.strip().startswith('#') and ('- page:' in line or 'path:' in line):# Remove comment while preserving indentationuncommented = line.replace('# ', '', 1) if '# ' in line else line.replace('#', '', 1)@@ -60,30 +60,30 @@ def process_tool_docs(file_path: Path, action: str) -> None:print("Error: No navigation section found in docs.yml")return- # Find the tools tab+ # Find the toolkits tabtools_tab = Nonefor tab in data['navigation']:- if isinstance(tab, CommentedMap) and tab.get('tab') == 'tools':+ if isinstance(tab, CommentedMap) and tab.get('tab') == 'toolkits':tools_tab = tabbreakif not tools_tab:- print("Error: No tools tab found in navigation")+ print("Error: No toolkits tab found in navigation")return- # Find the tools section within the tools tab+ # Find the toolkits section within the toolkits tabif 'layout' not in tools_tab:- print("Error: No layout found in tools tab")+ print("Error: No layout found in toolkits tab")returntools_section = Nonefor section in tools_tab['layout']:- if isinstance(section, CommentedMap) and section.get('section') == 'Tools':+ if isinstance(section, CommentedMap) and section.get('section') == 'Toolkits':tools_section = sectionbreakif not tools_section or 'contents' not in tools_section:- print("Error: No contents found in Tools section")+ print("Error: No contents found in Toolkits section")returnif action == 'comment':@@ -92,7 +92,7 @@ def process_tool_docs(file_path: Path, action: str) -> None:yaml.dump(data, stream)content = stream.getvalue()- # Now manually comment out tools after the 1st one (introduction)+ # Now manually comment out toolkits after the 1st one (introduction)lines = content.split('\n')new_lines = []in_tools_section = False@@ -102,8 +102,8 @@ def process_tool_docs(file_path: Path, action: str) -> None:while i < len(lines):line = lines[i]- # Check if we're entering the tools section- if '- section: Tools' in line and 'tools' in '\n'.join(lines[max(0, i-10):i]):+ # Check if we're entering the toolkits section+ if '- section: Toolkits' in line and 'toolkits' in '\n'.join(lines[max(0, i-10):i]):in_tools_section = Truenew_lines.append(line)i += 1@@ -182,4 +182,4 @@ def main():if __name__ == '__main__':- exit(main())\ No newline at end of file+ exit(main())diff --git a/fern/turbo.json b/fern/turbo.jsonindex b7af4dfeb..b865db424 100644--- a/fern/turbo.json+++ b/fern/turbo.json@@ -4,7 +4,7 @@"tasks": {"build": {"dependsOn": ["api:pull", "add-og", "snippets:build", "tools:generate", "sdkdocs"],- "outputs": ["apis/openapi.json", "apis/openapi-mcp.json", "pages/dist/**", "tools/**"],+ "outputs": ["apis/openapi.json", "apis/openapi-mcp.json", "pages/dist/**", "toolkits/**"],"cache": true},@@ -48,7 +48,7 @@},"tools:generate": {- "outputs": ["tools/**"],+ "outputs": ["toolkits/**"],"inputs": ["generators/tool_doc_generator/**/*.py", "generators/tool_doc_generator/templates/**/*"],"cache": true,"env": ["COMPOSIO_API_KEY"]@@ -82,7 +82,7 @@"llms:build": {"dependsOn": ["build"],"outputs": ["llms-txt/public/llms.txt"],- "inputs": ["docs.yml", "pages/**/*.mdx", "pages/**/*.md", "tools/**/*.mdx", "scripts/build-llms-txt.ts"],+ "inputs": ["docs.yml", "pages/**/*.mdx", "pages/**/*.md", "toolkits/**/*.mdx", "scripts/build-llms-txt.ts"],"cache": true},@@ -129,4 +129,4 @@"cache": true}}-}\ No newline at end of file+}diff --git a/ts/packages/core/src/models/Tools.ts b/ts/packages/core/src/models/Tools.tsindex 085277e77..d73f3a975 100644--- a/ts/packages/core/src/models/Tools.ts+++ b/ts/packages/core/src/models/Tools.ts@@ -108,7 +108,7 @@ export class Tools<inputParameters: tool.input_parameters,outputParameters: tool.output_parameters,availableVersions: tool.available_versions,- isDeprecated: tool.is_deprecated,+ isDeprecated: tool.deprecated?.is_deprecated ?? false,isNoAuth: tool.no_auth,});}