Skip to main content
Glama
luiso2

Evolution API WhatsApp MCP Server

by luiso2

create_instance

Create a new WhatsApp Business instance for sending messages, managing contacts, and handling events through webhooks with QR code authentication.

Instructions

Create a new WhatsApp instance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceNameYesName for the instance
qrcodeNoGenerate QR code for connection
webhookUrlNoWebhook URL for events

Implementation Reference

  • src/index.ts:43-55 (registration)
    Registration of the 'create_instance' tool in the MCP tools array, including description and input schema definition.
    {
      name: 'create_instance',
      description: 'Create a new WhatsApp instance',
      inputSchema: {
        type: 'object',
        properties: {
          instanceName: { type: 'string', description: 'Name for the instance' },
          qrcode: { type: 'boolean', description: 'Generate QR code for connection' },
          webhookUrl: { type: 'string', description: 'Webhook URL for events' }
        },
        required: ['instanceName']
      }
    },
  • Input schema validation for the create_instance tool parameters.
    inputSchema: {
      type: 'object',
      properties: {
        instanceName: { type: 'string', description: 'Name for the instance' },
        qrcode: { type: 'boolean', description: 'Generate QR code for connection' },
        webhookUrl: { type: 'string', description: 'Webhook URL for events' }
      },
      required: ['instanceName']
    }
  • Main MCP handler function for 'create_instance' tool. Delegates to EvolutionAPI service and formats response as MCP content.
    private async handleCreateInstance(args: any) {
      const result = await evolutionAPI.createInstance(args);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • Supporting utility in EvolutionAPI service that performs the actual HTTP POST request to the backend /instance/create endpoint to create the WhatsApp instance.
    async createInstance(data: {
      instanceName: string;
      qrcode?: boolean;
      integration?: string;
      webhookUrl?: string;
      webhookByEvents?: boolean;
      webhookBase64?: boolean;
      webhookHeaders?: Record<string, string>;
    }): Promise<Instance> {
      const response = await this.client.post('/instance/create', data);
      return response.data;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits. It only states it creates an instance but does not explain what that entails (e.g., if it triggers a connection, returns credentials, or requires authentication). This is insufficient for an agent to understand side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with one sentence that states the purpose. While efficient, it could include more detail without becoming verbose, but it has no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (3 params, no output schema, no annotations), the description is incomplete. It lacks information about return values, side effects, and usage steps, which are important for a creation action.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters. The description adds no extra meaning or context beyond the schema, meeting the baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Create a new WhatsApp instance' uses a specific verb and resource, clearly distinguishing it from sibling tools like connect_instance, delete_instance, and instance_status. The purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives (e.g., connect_instance for existing instances). There is no mention of prerequisites or context for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.