Skip to main content
Glama
ExoCubeYT

OpenWA MCP Server

by ExoCubeYT

get_labels

Retrieve all labels and tags assigned to a WhatsApp session. Use a session ID to get a complete list of labels for organizing chats.

Instructions

List all labels/tags in the WhatsApp session

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID

Implementation Reference

  • Registers the 'get_labels' tool via server.registerTool with its schema and handler.
    export function registerLabelTools(server: McpServer) {
      server.registerTool(
        "get_labels",
        {
          description: "List all labels/tags in the WhatsApp session",
          inputSchema: {
            sessionId: z.string().describe("Session ID"),
          },
        },
        async ({ sessionId }) => {
          const data = await openwaClient({ method: "GET", path: `/sessions/${sessionId}/labels` });
          return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
        }
      );
  • The tool name 'get_labels' is the identifier string passed to registerTool.
    "get_labels",
  • Input schema definition for 'get_labels': requires a sessionId (string) parameter.
    {
      description: "List all labels/tags in the WhatsApp session",
      inputSchema: {
        sessionId: z.string().describe("Session ID"),
      },
    },
  • Handler function for 'get_labels' that calls openwaClient with GET /sessions/{sessionId}/labels and returns the response as JSON text.
    async ({ sessionId }) => {
      const data = await openwaClient({ method: "GET", path: `/sessions/${sessionId}/labels` });
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
  • src/index.ts:10-10 (registration)
    Imports registerLabelTools from the labels module.
    import { registerLabelTools } from "./tools/labels.js";
Behavior2/5

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

Minimal disclosure beyond read-only nature; no details on pagination, ordering, or return format; no annotations to supplement.

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?

Single concise sentence front-loaded with action and resource; no unnecessary words.

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?

Adequate for a simple list tool with one required parameter; lacks return format info but no output schema exists.

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 covers 100% of parameters with description 'Session ID'; description adds no extra meaning beyond schema.

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?

Description clearly states verb 'List' and resource 'all labels/tags in the WhatsApp session', distinguishing it from sibling tools like create_label or delete_label.

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

Usage Guidelines3/5

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

No explicit when-to-use or alternatives, but the simple list operation is self-explanatory; missing context like prerequisites.

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/ExoCubeYT/openwa-mcp'

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