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;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool creates something, implying a write/mutation operation, but doesn't disclose critical behaviors: whether this requires specific permissions, what happens on success/failure (e.g., returns an instance ID), if it's idempotent, or any rate limits. The description is minimal and lacks operational context.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately scannable. Every word ('Create', 'new', 'WhatsApp instance') earns its place by conveying essential information without redundancy.

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 complexity of creating a WhatsApp instance (a write operation with potential side effects), no annotations, and no output schema, the description is incomplete. It doesn't explain what constitutes a 'WhatsApp instance' in this system, what the tool returns (e.g., instance ID, status), or error conditions. For a mutation tool with 3 parameters, this leaves significant gaps for the agent.

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 fully documents all three parameters (instanceName, qrcode, webhookUrl) with their types and purposes. The description adds no parameter information beyond what the schema provides, maintaining the baseline score of 3. It doesn't explain interactions between parameters (e.g., how qrcode relates to instance creation).

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

Purpose4/5

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

The description clearly states the action ('Create') and resource ('new WhatsApp instance'), making the purpose immediately understandable. It distinguishes from siblings like 'connect_instance' (which implies connecting to an existing instance) and 'delete_instance' (which removes an instance). However, it doesn't specify what a 'WhatsApp instance' entails beyond the basic concept.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing authentication), when not to use it (e.g., if an instance already exists), or how it relates to siblings like 'connect_instance' or 'list_instances'. The agent must infer usage from context alone.

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

Install Server

Other 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/luiso2/mcp-evolution-api'

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