Skip to main content
Glama

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

NameRequiredDescriptionDefault
botIdYes
overwriteNo
typebotYes

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

  • 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; }
  • 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(), }), }],
  • 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(), }),

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/osdeibi/MCP-typebot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server