Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | import { VercelProvider, type VercelToolCollection } from '@composio/vercel'; |
| 2 | import type { Tool as ComposioTool, ExecuteToolFn } from '@composio/core'; |
| 3 | import type { ToolSet } from 'ai'; |
| 4 | |
| 5 | const composioTool = { |
| 6 | slug: 'TEST_TOOL', |
| 7 | name: 'Test Tool', |
| 8 | description: 'A tool used by the AI SDK compatibility fixture', |
| 9 | version: '20260625_00', |
| 10 | availableVersions: ['20260625_00'], |
| 11 | inputParameters: { |
| 12 | type: 'object', |
| 13 | properties: { |
| 14 | query: { |
| 15 | type: 'string', |
| 16 | description: 'Query text', |
| 17 | }, |
| 18 | }, |
| 19 | required: ['query'], |
| 20 | }, |
| 21 | tags: [], |
| 22 | } satisfies ComposioTool; |
| 23 | |
| 24 | const executeTool = (async () => ({ |
| 25 | data: { ok: true }, |
| 26 | error: null, |
| 27 | successful: true, |
| 28 | })) satisfies ExecuteToolFn; |
| 29 | |
| 30 | const provider = new VercelProvider(); |
| 31 | const tools = provider.wrapTools([composioTool], executeTool); |
| 32 | |
| 33 | // Assignability smoke check: the wrapped collection must satisfy both the |
| 34 | // provider's exported type and the installed AI SDK's ToolSet. |
| 35 | const _wrappedToolSet: VercelToolCollection = tools satisfies ToolSet; |