Skip to main content
Glama

createBot

Generate a new Typebot chatbot by specifying a name and optional description. Ideal for quickly setting up chatbot workflows using the MCP-Typebot server’s JSON interface.

Instructions

Crea un nuevo Typebot. Requiere “name”, opcional “description”

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNo
nameYes
workspaceIdNo

Implementation Reference

  • The core handler function that ensures authentication, derives workspaceId, builds the payload, and creates a new Typebot via API POST request.
    export async function createBot(args: CreateBotArgs) {
      ensureAuth(); 
      const workspaceId =
        args.workspaceId || process.env.TYPEBOT_WORKSPACE_ID;
      if (!workspaceId) {
        throw new Error(
          'createBot: falta workspaceId (ni en args ni en process.env)'
        );
      }
    
      const payload = {
        workspaceId,
        typebot: {
          name: args.name,
          description: args.description,
        },
      };
    
      const response = await axios.post(
        'https://app.typebot.io/api/v1/typebots',
        payload
      );
      return response.data;
    }
  • Zod schema for input validation of the createBot tool, matching the CreateBotArgs interface.
    schema: z.object({
      workspaceId: z.string().optional(),
      name:        z.string().min(1, "El campo 'name' es obligatorio."),
      description: z.string().optional(),
    }),
  • src/index.ts:36-44 (registration)
    Tool registration entry in toolsMap, linking the createBot function, its description, and schema for MCP server registration.
    ['createBot', {
      func: createBot,
      description: 'Crea un nuevo Typebot. Requiere “name”, opcional “description”',
      schema: z.object({
        workspaceId: z.string().optional(),
        name:        z.string().min(1, "El campo 'name' es obligatorio."),
        description: z.string().optional(),
      }),
    }],
  • TypeScript type definition for CreateBotArgs used in the handler function signature.
    export interface CreateBotArgs {
      workspaceId?: string;
      name: string;
      description?: string;
    }
  • Helper function ensureAuth() called at the start of createBot to verify Authorization token is set.
    function ensureAuth() {
      const header = axios.defaults.headers.common['Authorization'];
      if (!header) {
        throw new Error(
          'No hay token configurado. Llama primero a authenticate o define TYPEBOT_TOKEN.'
        );
      }
    }
Install Server

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