Skip to main content
Glama
billyfranklim1

mcp-evolution

Find Labels

find_labels

List all WhatsApp labels for the pinned instance. Returns normalized label IDs, names, and colors.

Instructions

List all WhatsApp labels for the pinned instance (requires WhatsApp Business). Returns normalized { id, name, color } array — nested chat blobs dropped to prevent overflow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler/registration for the 'find_labels' tool. Calls the Evolution API endpoint /label/findLabels/{instanceName}, normalizes the raw response by extracting only id, name, and color fields, and returns JSON output.
    export function registerFindLabels(server: McpServer, client: EvolutionClient): void {
      server.registerTool(
        "find_labels",
        {
          title: "Find Labels",
          description:
            "List all WhatsApp labels for the pinned instance (requires WhatsApp Business). " +
            "Returns normalized { id, name, color } array — nested chat blobs dropped to prevent overflow.",
          inputSchema: {},
        },
        async () => {
          try {
            const data = await client.get(`/label/findLabels/${client.instanceName}`);
            const raw: RawLabel[] = Array.isArray(data) ? data : [];
    
            const normalized = raw.map(({ id, name, color }) => ({ id, name, color }));
    
            return { content: [{ type: "text" as const, text: JSON.stringify(normalized, null, 2) }] };
          } catch (e) {
            if (e instanceof McpError) return { isError: true, content: [{ type: "text" as const, text: e.message }] };
            throw e;
          }
        }
      );
    }
  • Type definition for the raw label data returned from the API. The input schema is empty ({}) meaning no parameters are required.
    interface RawLabel {
      id?: string;
      name?: string;
      color?: string | number;
      [key: string]: unknown;
    }
  • Registration call in the central registerAllTools function. The import is on line 69.
    // Label
    registerFindLabels(server, client);
    registerHandleLabel(server, client);
  • Import of the registerFindLabels function from the find-labels module.
    // Label
    import { registerFindLabels } from "./find-labels.js";
    import { registerHandleLabel } from "./handle-label.js";
Behavior4/5

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

With no annotations, the description discloses output format, data normalization, and that nested chat blobs are dropped to prevent overflow. It also mentions the Business requirement. Could expand on potential limitations but sufficient for a simple list tool.

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 two sentences, front-loaded with the core purpose, and contains no unnecessary words. Every sentence adds value.

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

Completeness5/5

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

Given no parameters and no output schema, the description covers purpose, requirements, output format, and a behavioral note about pruning nested data. It is complete for this tool's complexity.

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 description adds value by explaining the return format and business requirement, which is beyond the empty schema baseline of 4.

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 states the tool lists all WhatsApp labels for the pinned instance, specifies a prerequisite (requires WhatsApp Business), and describes the output format. It distinguishes from sibling 'handle_label' which likely handles individual label operations.

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

Usage Guidelines4/5

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

The description provides the prerequisite (WhatsApp Business) and implicitly indicates usage to list labels. It lacks explicit guidance on when not to use or alternatives, but context makes it clear.

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