listBots
Retrieve a list of all Typebots in a specific workspace using the workspace ID. Manage and organize your chatbot projects effectively with this streamlined JSON-based tool.
Instructions
Lista todos los Typebots de un workspace
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspaceId | No |
Implementation Reference
- src/tools/bots.ts:47-62 (handler)The core handler function that executes the listBots tool: authenticates the request, resolves the workspaceId from args or environment, queries the Typebot API for typebots in that workspace, and returns the response data.export async function listBots(args: ListBotsArgs = {}) { ensureAuth(); const workspaceId = args.workspaceId || process.env.TYPEBOT_WORKSPACE_ID; if (!workspaceId) { throw new Error( 'listBots: falta workspaceId (ni en args ni en process.env)' ); } const response = await axios.get( 'https://app.typebot.io/api/v1/typebots', { params: { workspaceId } } ); return response.data; }
- src/tools/bots.ts:43-45 (schema)TypeScript interface defining the expected input arguments for the listBots handler function.export interface ListBotsArgs { workspaceId?: string; }
- src/index.ts:45-49 (registration)Tool registration entry in the toolsMap: associates the name 'listBots' with its handler function, description, and Zod input schema. This map is used in a loop to register each tool with the MCP server via server.registerTool.['listBots', { func: listBots, description: 'Lista todos los Typebots de un workspace', schema: z.object({ workspaceId: z.string().optional() }), }],
- src/index.ts:48-48 (schema)Zod schema used for input validation of the listBots tool during MCP registration.schema: z.object({ workspaceId: z.string().optional() }),