updateBot
Modify an existing Typebot by updating its properties such as name through the MCP-Typebot server, using a structured JSON input with botId and typebot details.
Instructions
Actualiza un Typebot existente (p.ej. cambia nombre)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| botId | Yes | ||
| overwrite | No | ||
| typebot | Yes |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"botId": {
"minLength": 1,
"type": "string"
},
"overwrite": {
"type": "boolean"
},
"typebot": {
"additionalProperties": {},
"type": "object"
}
},
"required": [
"botId",
"typebot"
],
"type": "object"
}
Implementation Reference
- src/tools/bots.ts:85-122 (handler)The core handler function implementing the updateBot tool. It authenticates, fetches the current bot version, applies changes via PATCH to the Typebot API, and returns the result.export async function updateBot(args: UpdateBotArgs) { ensureAuth(); const { botId, typebot: changes, overwrite = false } = args; if (!botId) throw new Error('updateBot: falta botId'); if (typeof changes !== 'object' || Object.keys(changes).length === 0) { throw new Error( 'updateBot: el objeto `typebot` con campos a cambiar es obligatorio' ); } const getRes = await axios.get<{ typebot: { version: string } }>( `https://app.typebot.io/api/v1/typebots/${botId}` ); const version = getRes.data.typebot.version; if (!version) { throw new Error( 'updateBot: no pude obtener la versión actual del Typebot' ); } const payload: Record<string, any> = { typebot: { version, ...changes } }; if (overwrite) { payload.overwrite = true; } const patchRes = await axios.patch( `https://app.typebot.io/api/v1/typebots/${botId}`, payload ); return patchRes.data; }
- src/tools/bots.ts:79-83 (schema)TypeScript interface defining the input schema for the updateBot function.export interface UpdateBotArgs { botId: string; typebot: Record<string, any>; overwrite?: boolean; }
- src/index.ts:55-63 (registration)Registration entry for the updateBot tool in the toolsMap, including the handler function reference, description, and Zod input schema for MCP server registration.['updateBot', { func: updateBot, description: 'Actualiza un Typebot existente (p.ej. cambia nombre)', schema: z.object({ botId: z.string().min(1, "El campo 'botId' es obligatorio."), typebot: z.record(z.any()).refine(x => typeof x === 'object', "El campo 'typebot' es obligatorio."), overwrite: z.boolean().optional(), }), }],
- src/index.ts:58-62 (schema)Zod schema used for input validation of updateBot tool in the MCP server.schema: z.object({ botId: z.string().min(1, "El campo 'botId' es obligatorio."), typebot: z.record(z.any()).refine(x => typeof x === 'object', "El campo 'typebot' es obligatorio."), overwrite: z.boolean().optional(), }),