Skip to main content
Glama

startChat

Initiate a chat session with a Typebot using a specific botId, optionally include chat context for personalized interactions via the MCP-Typebot server.

Instructions

Inicia un chat con un Typebot. Requiere botId, opcional chat.context

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
botIdYes
chatNo

Implementation Reference

  • The core handler function that implements the 'startChat' tool logic. It authenticates, validates botId, prepares payload with optional chat context, and POSTs to Typebot API to start a chat session.
    export async function startChat(args: StartChatArgs) {
      ensureAuth();
    
      const { botId, chat } = args;
      if (!botId) throw new Error('startChat: falta botId');
    
      const payload: Record<string, any> = {};
      if (chat) payload.chat = chat;
    
      const response = await axios.post(
        `https://app.typebot.io/api/v1/typebots/${botId}/chat/start`,
        payload
      );
      return response.data;
    }
  • TypeScript interface defining the input parameters for the startChat function: required botId and optional chat object with context.
    export interface StartChatArgs {
      botId: string;
      chat?: {
        context?: Record<string, any>;
      };
    }
  • Zod schema for input validation of the 'startChat' tool, used in MCP tool registration.
    schema: z.object({
      botId: z.string().min(1, "El campo 'botId' es obligatorio."),
      chat: z.object({
        context: z.record(z.any()).optional(),
      }).optional(),
    }),
  • src/index.ts:90-99 (registration)
    Registration entry in toolsMap for the 'startChat' tool, including func reference, description, and input schema, which is later used to register the tool with the MCP server.
    ['startChat', {
      func: startChat,
      description: 'Inicia un chat con un Typebot. Requiere botId, opcional chat.context',
      schema: z.object({
        botId: z.string().min(1, "El campo 'botId' es obligatorio."),
        chat: z.object({
          context: z.record(z.any()).optional(),
        }).optional(),
      }),
    }],
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