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
Add Tools and Triggers section with fetching-tools page
Sushmithamallesh67385a8dbf65
diff --git a/fumadocs/app/(home)/docs/layout.tsx b/fumadocs/app/(home)/docs/layout.tsxindex 4ca9775f2..464140e93 100644--- a/fumadocs/app/(home)/docs/layout.tsx+++ b/fumadocs/app/(home)/docs/layout.tsx@@ -1,17 +1,15 @@import { source } from '@/lib/source';import { DocsLayout } from 'fumadocs-ui/layouts/docs';-// Add changelog to the page tree+// Insert changelog into page tree at correct position (after capabilities, before Tools and Triggers)+const changelogPage = { type: 'page' as const, name: 'Changelog', url: '/docs/changelog' };const pageTree = {- name: source.pageTree.name,- children: [- ...source.pageTree.children,- {- type: 'page' as const,- name: 'Changelog',- url: '/docs/changelog',- },- ],+ ...source.pageTree,+ children: source.pageTree.children.flatMap((child) =>+ child.type === 'separator' && child.name === 'Tools and Triggers'+ ? [changelogPage, child]+ : child+ ),};export default function Layout({ children }: LayoutProps<'/docs'>) {diff --git a/fumadocs/app/global.css b/fumadocs/app/global.cssindex ad520d6fb..5e05f1f39 100644--- a/fumadocs/app/global.css+++ b/fumadocs/app/global.css@@ -216,6 +216,7 @@ pre {:is(.prose, [data-fumadocs-body]) a:not([data-card]) {color: var(--composio-orange);+ text-decoration: none;}/* Heading anchors stay neutral */diff --git a/fumadocs/content/docs/fetching-tools.mdx b/fumadocs/content/docs/fetching-tools.mdxnew file mode 100644index 000000000..ef3b68e6f--- /dev/null+++ b/fumadocs/content/docs/fetching-tools.mdx@@ -0,0 +1,214 @@+---+title: Fetching tools and schemas+description: Fetch and filter tools, and inspect schemas+---++Fetch specific tools, filter by permissions or search, and inspect schemas for type information. Tools are automatically formatted for your provider.++## Basic usage++<Tabs groupId="language" items={['Python', 'TypeScript']} persist>+ <Tab value="Python">+```python+tools = composio.tools.get(+ user_id,+ toolkits=["GITHUB"]+)+```+ </Tab>+ <Tab value="TypeScript">+```typescript+const tools = await composio.tools.get(userId, {+ toolkits: ["GITHUB"]+});+```+ </Tab>+</Tabs>++Returns top 20 tools by default. Tools require a `user_id` because they're scoped to authenticated accounts. See [User management](/docs/user-management) and [Authentication](/docs/authenticating-tools).++## Tool schemas++Inspect tool parameters and types without a user_id:++<Tabs groupId="language" items={['Python', 'TypeScript']} persist>+ <Tab value="Python">+```python+tool = composio.tools.get_raw_composio_tool_by_slug("GMAIL_SEND_EMAIL")+```+ </Tab>+ <Tab value="TypeScript">+```typescript+const tool = await composio.tools.getRawComposioToolBySlug("GMAIL_SEND_EMAIL");+```+ </Tab>+</Tabs>++Generate type-safe code for direct SDK execution with [`composio generate`](/docs/cli#generate-type-definitions). This creates TypeScript or Python types from tool schemas.++<Callout type="info">+View tool parameters and schemas visually in the [Composio platform](https://platform.composio.dev). Navigate to any toolkit and select a tool to see its input/output parameters.+</Callout>++## Filtering tools++### By toolkit++Get tools from specific apps. Returns top 20 tools by default.++<Tabs groupId="language" items={['Python', 'TypeScript']} persist>+ <Tab value="Python">+```python+# Fetch with limit for a specific user+tools = composio.tools.get(+ user_id,+ toolkits=["GITHUB"],+ limit=5 # Get top 5 tools+)++# Same filter but without user_id (for schemas)+raw_tools = composio.tools.get_raw_composio_tools(+ toolkits=["GITHUB"],+ limit=5+)+```+ </Tab>+ <Tab value="TypeScript">+```typescript+// Fetch with limit for a specific user+const limitedTools = await composio.tools.get(userId, {+ toolkits: ["GITHUB"],+ limit: 5 // Get top 5 tools+});++// Same filter but without userId (for schemas)+const rawTools = await composio.tools.getRawComposioTools({+ toolkits: ["GITHUB"],+ limit: 5+});+```+ </Tab>+</Tabs>++### By name++Fetch specific tools when you know their names.++<Tabs groupId="language" items={['Python', 'TypeScript']} persist>+ <Tab value="Python">+```python+# Fetch specific tools by name+tools = composio.tools.get(+ user_id,+ tools=["GITHUB_CREATE_ISSUE", "GITHUB_CREATE_PULL_REQUEST"]+)++# Get schemas without user_id+raw_tools = composio.tools.get_raw_composio_tools(+ tools=["GITHUB_CREATE_ISSUE", "GITHUB_CREATE_PULL_REQUEST"]+)+```+ </Tab>+ <Tab value="TypeScript">+```typescript+// Fetch specific tools by name+const specificTools = await composio.tools.get(userId, {+ tools: ["GITHUB_LIST_STARGAZERS", "GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER"]+});++// Get schemas without userId+const specificRawTools = await composio.tools.getRawComposioTools({+ tools: ["GITHUB_LIST_STARGAZERS", "GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER"]+});+```+ </Tab>+</Tabs>++### By scopes++Filter OAuth tools by permission level. Only works with a single toolkit.++<Tabs groupId="language" items={['Python', 'TypeScript']} persist>+ <Tab value="Python">+```python+# Filter by OAuth scopes (single toolkit only)+tools = composio.tools.get(+ user_id,+ toolkits=["GITHUB"],+ scopes=["write:org"]+)+```+ </Tab>+ <Tab value="TypeScript">+```typescript+// Filter by OAuth scopes (single toolkit only)+const scopedTools = await composio.tools.get(userId, {+ toolkits: ["GITHUB"],+ scopes: ["write:org"]+});+```+ </Tab>+</Tabs>++### By search (experimental)++Find tools semantically.++<Tabs groupId="language" items={['Python', 'TypeScript']} persist>+ <Tab value="Python">+```python+# Search tools semantically+tools = composio.tools.get(+ user_id,+ search="create calendar event"+)++# Search schemas without user_id+raw_tools = composio.tools.get_raw_composio_tools(+ search="create calendar event"+)++# Search within a specific toolkit+tools = composio.tools.get(+ user_id,+ search="issues",+ toolkits=["GITHUB"],+)++# Search toolkit schemas without user_id+raw_tools = composio.tools.get_raw_composio_tools(+ search="issues",+ toolkits=["GITHUB"]+)+```+ </Tab>+ <Tab value="TypeScript">+```typescript+// Search tools semantically+const searchResults = await composio.tools.get(userId, {+ search: "create google calendar event"+});++// Search schemas without userId+const searchRawTools = await composio.tools.getRawComposioTools({+ search: "create google calendar event"+});++// Search within a specific toolkit+const toolkitSearch = await composio.tools.get(userId, {+ search: "star a repository",+ toolkits: ["GITHUB"]+});++// Search toolkit schemas without userId+const toolkitSearchRaw = await composio.tools.getRawComposioTools({+ search: "star a repository",+ toolkits: ["GITHUB"]+});+```+ </Tab>+</Tabs>++<Callout type="info">+Use specific toolkit versions in production to prevent breaking changes. See [toolkit versioning](/docs/toolkit-versioning).+</Callout>diff --git a/fumadocs/content/docs/meta.json b/fumadocs/content/docs/meta.jsonindex 96ad10ce5..402439578 100644--- a/fumadocs/content/docs/meta.json+++ b/fumadocs/content/docs/meta.json@@ -1,3 +1,10 @@{- "pages": ["welcome", "quickstart", "capabilities"]+ "pages": [+ "---Get Started---",+ "welcome",+ "quickstart",+ "capabilities",+ "---Tools and Triggers---",+ "fetching-tools"+ ]}