docs/content/docs/toolkits/fetching-tools-and-toolkits.mdx
When using sessions, fetch tools through the session object.
session.toolkits() returns toolkits enabled for your session, sorted by popularity. By default, it returns the top 20. Each toolkit includes its slug, name, logo, and connection status.
<Tabs groupId="language" items={['Python', 'TypeScript']} persist> <Tab value="Python">
session = composio.create(user_id="user_123")
result = session.toolkits()
for toolkit in result.items:
print(f"{toolkit.name}: connected={toolkit.connection.is_active if toolkit.connection else 'n/a'}")
const result = await session.toolkits();
for (const toolkit of result.items) {
console.log(${toolkit.name}: connected=${toolkit.connection?.isActive ?? 'n/a'});
}
</Tab>
</Tabs>
You can filter to only show connected toolkits:
<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
<Tab value="Python">
```python
connected = session.toolkits(is_connected=True) # Only connected
To fetch all toolkits, paginate through the results:
<Tabs groupId="language" items={['Python', 'TypeScript']} persist> <Tab value="Python">
all_toolkits = []
cursor = None
while True:
result = session.toolkits(limit=20, next_cursor=cursor)
all_toolkits.extend(result.items)
cursor = result.next_cursor
if not cursor:
break
do { const { items, nextCursor } = await session.toolkits({ limit: 20, nextCursor: cursor }); allToolkits.push(...items); cursor = nextCursor; } while (cursor);
</Tab>
</Tabs>
### Get meta tools
`session.tools()` returns the [meta tools](/reference/meta-tools) formatted for your configured provider (OpenAI, Anthropic, etc.):
<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
<Tab value="Python">
```python
# Get all meta tools
tools = session.tools()
To restrict which toolkits or tools are discoverable by the meta tools, configure them when creating the session.
Before configuring a session, you may want to explore what toolkits and tools are available. You can browse visually at platform.composio.dev or in the docs, or fetch programmatically:
<Tabs groupId="language" items={['Python', 'TypeScript']} persist> <Tab value="Python">
# List toolkits
toolkits = composio.toolkits.get()
# List tools within a toolkit (top 20 by default)
tools = composio.tools.get("user_123", toolkits=["GITHUB"])
// List tools within a toolkit (top 20 by default) const tools = await composio.tools.get(userId, { toolkits: ["GITHUB"] });
</Tab>
</Tabs>
### Get a tool's schema
To inspect a tool's input parameters and types without needing a user context, use `getRawComposioToolBySlug`:
<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
<Tab value="Python">
```python
tool = composio.tools.get_raw_composio_tool_by_slug("GMAIL_SEND_EMAIL")
print(tool.name)
print(tool.description)
print(tool.input_parameters)
print(tool.output_parameters)