Skip to main content
Glama
billyfranklim1

mcp-evolution

Connection State

connection_state

Check the current connection state of your pinned WhatsApp instance to determine if it is open, closed, or connecting.

Instructions

Get the current connection state of the pinned WhatsApp instance (open, close, connecting).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that registers and implements the 'connection_state' tool. It calls the Evolution API endpoint /instance/connectionState/{instanceName} and returns the connection state data.
    export function registerConnectionState(server: McpServer, client: EvolutionClient): void {
      server.registerTool(
        "connection_state",
        {
          title: "Connection State",
          description: "Get the current connection state of the pinned WhatsApp instance (open, close, connecting).",
          inputSchema: {},
        },
        async () => {
          try {
            const data = await client.get(`/instance/connectionState/${client.instanceName}`);
            return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
          } catch (e) {
            if (e instanceof McpError) return { isError: true, content: [{ type: "text" as const, text: e.message }] };
            throw e;
          }
        }
      );
    }
  • Registration call that wires up the connection_state tool handler.
    registerConnectionState(server, client);
  • Import of the registerConnectionState function from its module.
    import { registerConnectionState } from "./connection-state.js";
Behavior3/5

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

No annotations are provided, so the description must carry the burden of behavioral disclosure. It states 'Get' implying a non-destructive read, but does not explicitly confirm safety, authentication needs, or any side effects. For a simple state query, this is adequate but not enriched.

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?

A single sentence that front-loads the verb and resource, with no extraneous words. Every part of the description is essential and well-structured.

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

Completeness3/5

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

The description lacks details about the return format or possible error states. Since there is no output schema, the description should at least hint at what the output contains (e.g., a string). However, for a simple state tool, it is borderline adequate.

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

Parameters4/5

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

The input schema has zero parameters, so schema coverage is 100%. The baseline for parameterless tools is 4, and the description does not need to add parameter details. No additional value is required.

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 clearly identifies the action ('Get'), the resource ('current connection state'), and the possible values ('open, close, connecting'), distinguishing it from sibling tools that perform messaging, group management, or other actions.

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 on when to use this tool (e.g., before sending messages to check connectivity) or alternatives. While the purpose is clear, the description lacks context for appropriate usage.

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/billyfranklim1/mcp-evolution'

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