Skip to main content
Glama
wsapi-chat

WSAPI WhatsApp MCP Server

whatsapp_send_document

Send a file as a WhatsApp document from base64 data or a public URL, with a required filename and optional caption. Use it for PDFs and files that should not appear inline as media.

Instructions

Send a file as a document, from base64 data or a public URL, with a required filename and optional caption. Use it for PDFs and any file that should not be shown inline as media. Not idempotent. Returns the message ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesRecipient JID
urlNoURL of the document
dataNoBase64 encoded document data
captionNoCaption for the document
replyToNo
filenameYesFilename shown to recipient
mentionsNo
mimeTypeNoMIME type (auto-detected if omitted)
isForwardedNo
replyToSenderIdNo
ephemeralExpirationNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed19 schema fields changedv2.0.0
    • changedInput schema / properties / caption / description
      Previous value: -"Caption for the document (max 1024 characters)"New value: +"Caption for the document"
    • removedInput schema / properties / caption / optional
      Removed value: -true
    • addedInput schema / properties / data
      Added value: +{
      +  "description": "Base64 encoded document data",
      +  "type": "string"
      +}
    • removedInput schema / properties / documentBase64
      Removed value: -{
      -  "description": "Base64 encoded document data (alternative to documentURL)",
      -  "optional": true,
      -  "type": "string"
      -}
    • removedInput schema / properties / documentURL
      Removed value: -{
      -  "description": "URL of the document to send (alternative to documentBase64)",
      -  "optional": true,
      -  "type": "string"
      -}
    • addedInput schema / properties / ephemeralExpiration
      Added value: +{
      +  "enum": [
      +    "off",
      +    "24h",
      +    "7d",
      +    "90d"
      +  ],
      +  "type": "string"
      +}
    • removedInput schema / properties / fileName
      Removed value: -{
      -  "description": "Name of the document file (max 255 characters)",
      -  "type": "string"
      -}
    • addedInput schema / properties / filename
      Added value: +{
      +  "description": "Filename shown to recipient",
      +  "type": "string"
      +}
    • removedInput schema / properties / isForwarded / description
      Removed value: -"Whether the message should be marked as forwarded"
    • removedInput schema / properties / isForwarded / optional
      Removed value: -true
    • removedInput schema / properties / mentions / description
      Removed value: -"List of phone numbers to mention in the caption"
    • removedInput schema / properties / mentions / optional
      Removed value: -true
    • addedInput schema / properties / mimeType
      Added value: +{
      +  "description": "MIME type (auto-detected if omitted)",
      +  "type": "string"
      +}
    • removedInput schema / properties / replyTo / description
      Removed value: -"ID of the message being replied to"
    • removedInput schema / properties / replyTo / optional
      Removed value: -true
    • addedInput schema / properties / replyToSenderId
      Added value: +{
      +  "type": "string"
      +}
    • changedInput schema / properties / to / description
      Previous value: -"Recipient phone number (with @s.whatsapp.net) or group ID (with @g.us)"New value: +"Recipient JID"
    • addedInput schema / properties / url
      Added value: +{
      +  "description": "URL of the document",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "to",
      -  "fileName"
      -]New value: +[
      +  "to",
      +  "filename"
      +]
  2. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare idempotentHint=false, so 'Not idempotent' largely repeats structured data. It does add useful context by stating it returns the message ID (no output schema exists), but says nothing about permission needs, size/rate limits, or what happens on failure.

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?

Three short sentences with zero waste: purpose/inputs first, the differentiator second, behavioral note last. Nothing could be removed without losing information.

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

Completeness4/5

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

For an 11-parameter, no-output-schema mutation tool, the description covers the core call shape and the return value. It would be stronger with a note on the ephemeralExpiration default and how mentions/replyTo behave, but it is largely sufficient.

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 coverage is 55%. The description clarifies data-vs-url sourcing, the required filename, and the optional caption, which is useful, but it is silent on mimeType auto-detection, mentions, replyTo, isForwarded, and the ephemeralExpiration enum, leaving half the parameters to the schema alone.

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?

States a specific verb+resource ('Send a file as a document'), names both supported input sources (base64 data or public URL), and explicitly distinguishes itself from inline-media siblings by noting files that 'should not be shown inline as media'.

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?

Gives a clear when-to-use rule ('Use it for PDFs and any file that should not be shown inline as media'), which routes the agent away from whatsapp_send_image/video/audio. No explicit exclusion of other edge cases (e.g. stickers) or prerequisites, but context is solid.

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

Deploy Server

Other Tools