Skip to main content
Glama

waha_send_location

Send location coordinates to WhatsApp chats using latitude and longitude data, enabling location sharing in conversations.

Instructions

Send location coordinates to a WhatsApp chat.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chatIdYesChat ID (format: number@c.us)
latitudeYesLatitude coordinate
longitudeYesLongitude coordinate
titleNoOptional title/name for the location
replyToNoOptional message ID to reply to

Implementation Reference

  • Handler function that executes the waha_send_location MCP tool. Validates input parameters, calls the underlying WAHAClient.sendLocation method, formats the success response using formatSendMessageSuccess, and returns structured MCP content with location details.
    private async handleSendLocation(args: any) {
      const chatId = args.chatId;
      const latitude = args.latitude;
      const longitude = args.longitude;
      const title = args.title;
      const replyTo = args.replyTo;
    
      if (!chatId) {
        throw new Error("chatId is required");
      }
    
      if (latitude === undefined || longitude === undefined) {
        throw new Error("latitude and longitude are required");
      }
    
      const response = await this.wahaClient.sendLocation({
        chatId,
        latitude,
        longitude,
        title,
        reply_to: replyTo,
      });
    
      const formattedResponse = formatSendMessageSuccess(
        chatId,
        response.id,
        response.timestamp
      );
    
      return {
        content: [
          {
            type: "text",
            text: `${formattedResponse}\nLocation: ${latitude}, ${longitude}${title ? `\nTitle: ${title}` : ''}`,
          },
        ],
      };
    }
  • Input schema and metadata definition for the waha_send_location tool, returned by the ListToolsRequestSchema handler.
      name: "waha_send_location",
      description: "Send location coordinates to a WhatsApp chat.",
      inputSchema: {
        type: "object",
        properties: {
          chatId: {
            type: "string",
            description: "Chat ID (format: number@c.us)",
          },
          latitude: {
            type: "number",
            description: "Latitude coordinate",
          },
          longitude: {
            type: "number",
            description: "Longitude coordinate",
          },
          title: {
            type: "string",
            description: "Optional title/name for the location",
          },
          replyTo: {
            type: "string",
            description: "Optional message ID to reply to",
          },
        },
        required: ["chatId", "latitude", "longitude"],
      },
    },
  • src/index.ts:1083-1084 (registration)
    Registration/dispatch case in the CallToolRequestSchema handler that routes calls to the waha_send_location tool to its handler function.
    case "waha_send_location":
      return await this.handleSendLocation(args);
  • WAHAClient.sendLocation helper method that performs the actual HTTP POST request to WAHA API endpoint /api/sendLocation to send the location message.
    async sendLocation(params: {
      chatId: string;
      latitude: number;
      longitude: number;
      title?: string;
      reply_to?: string;
    }): Promise<SendMessageResponse> {
      const { chatId, latitude, longitude, title, reply_to } = params;
    
      if (!chatId) {
        throw new WAHAError("chatId is required");
      }
    
      if (latitude === undefined || longitude === undefined) {
        throw new WAHAError("latitude and longitude are required");
      }
    
      const body = {
        chatId,
        latitude,
        longitude,
        title,
        session: this.session,
        reply_to,
      };
    
      return this.request<SendMessageResponse>("/api/sendLocation", {
        method: "POST",
        body: JSON.stringify(body),
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'send' implies a write operation, it doesn't disclose whether this requires specific permissions, whether it's synchronous/asynchronous, what happens on failure, or any rate limits. The description lacks crucial behavioral context for a messaging operation.

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 that states the core functionality without any wasted words. It's appropriately sized for a straightforward tool and is front-loaded with the essential information.

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?

For a messaging tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after sending (success/failure indicators), whether the location appears as a map preview, or any WhatsApp-specific behaviors. Given the complexity of messaging operations and lack of structured metadata, more context is needed.

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?

The schema description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 ('send location coordinates') and target ('to a WhatsApp chat'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like waha_send_message or waha_send_contact, which also send content to WhatsApp chats.

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. There's no mention of when location sending is appropriate versus sending text messages, media, or contacts, nor any prerequisites or exclusions for using this functionality.

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/seejux/waha-whatsapp-mcp'

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