Skip to content

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

Update snippets

Sushmithamallesh43fde69babe5
diff --git a/fern/pages/src/tool-calling/authenticating-tools.mdx b/fern/pages/src/tool-calling/authenticating-tools.mdx
index 4eff1a617..1a178bc49 100644
--- a/fern/pages/src/tool-calling/authenticating-tools.mdx
+++ b/fern/pages/src/tool-calling/authenticating-tools.mdx
@@ -377,13 +377,13 @@ You can check the status of a connected account programmatically:
src="fern/snippets/tool-calling/python/checking-connection-status.py"
title="Python"
startLine={5}
- endLine={15}
+ endLine={16}
/>
<SnippetCode
src="fern/snippets/tool-calling/typescript/checking-connection-status.ts"
title="Typescript"
startLine={5}
- endLine={16}
+ endLine={17}
/>
</CodeGroup>
diff --git a/fern/snippets/tool-calling/python/checking-connection-status.py b/fern/snippets/tool-calling/python/checking-connection-status.py
index 192752eed..4411ef9a2 100644
--- a/fern/snippets/tool-calling/python/checking-connection-status.py
+++ b/fern/snippets/tool-calling/python/checking-connection-status.py
@@ -6,10 +6,11 @@ composio = Composio(api_key="your_api_key")
connected_account = composio.connected_accounts.get("your_connected_account_id")
print(f"Status: {connected_account.status}")
-# Filter connections by user_id and auth_config_id
+# Filter connections by user_id, auth_config_id, and status (only active accounts)
filtered_connections = composio.connected_accounts.list(
user_ids=["user_123"],
- auth_config_ids=["your_auth_config_id"]
+ auth_config_ids=["your_auth_config_id"],
+ statuses=["ACTIVE"]
)
for connection in filtered_connections.items:
print(f"{connection.id}: {connection.status}")
diff --git a/fern/snippets/tool-calling/typescript/checking-connection-status.ts b/fern/snippets/tool-calling/typescript/checking-connection-status.ts
index d78ddb606..996c504d0 100644
--- a/fern/snippets/tool-calling/typescript/checking-connection-status.ts
+++ b/fern/snippets/tool-calling/typescript/checking-connection-status.ts
@@ -6,10 +6,11 @@ const composio = new Composio({ apiKey: 'your_api_key' });
const connectedAccount = await composio.connectedAccounts.get('your_connected_account_id');
console.log(`Status: ${connectedAccount.status}`);
-// Filter connections by user_id and auth_config_id
+// Filter connections by user_id, auth_config_id, and status (only active accounts)
const filteredConnections = await composio.connectedAccounts.list({
userIds: ['user_123'],
- authConfigIds: ['your_auth_config_id']
+ authConfigIds: ['your_auth_config_id'],
+ statuses: ['ACTIVE']
});
filteredConnections.items.forEach(connection => {
console.log(`${connection.id}: ${connection.status}`);