Skip to main content
Glama
Jem-HR
by Jem-HR

send_audio

Send audio messages via WhatsApp Business API by providing recipient details and audio source. Enables voice communication and media sharing in business conversations.

Instructions

Send an audio message.

Args: to: Phone number or WhatsApp ID audio: Audio URL or media ID reply_to_message_id: Message ID to reply to

Returns: Dictionary with success status and message ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYes
audioYes
reply_to_message_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Complete implementation of send_audio tool handler - sends audio messages to WhatsApp users with support for audio URL/media ID and optional reply-to functionality
    @mcp.tool()
    async def send_audio(
        to: str,
        audio: str,
        *,
        reply_to_message_id: Optional[str] = None,
    ) -> dict:
        """
        Send an audio message.
        
        Args:
            to: Phone number or WhatsApp ID
            audio: Audio URL or media ID
            reply_to_message_id: Message ID to reply to
        
        Returns:
            Dictionary with success status and message ID
        """
        try:
            result = wa_client.send_audio(
                to=to,
                audio=audio,
                reply_to_message_id=reply_to_message_id,
            )
            
            logger.info(f"Audio sent to {to}")
            message_id = getattr(result, 'id', str(result)) if result else None
            return {"success": True, "message_id": message_id}
        except Exception as e:
            logger.error(f"Failed to send audio: {str(e)}")
            return {"success": False, "error": str(e)}
  • Tool registration using @mcp.tool() decorator that exposes send_audio as an MCP tool
    @mcp.tool()
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('send an audio message') and return format, but lacks critical details: it doesn't mention authentication requirements, rate limits, error conditions, whether the audio is uploaded or referenced by URL/ID, or what happens if the send fails. For a mutation tool with zero annotation coverage, this is a significant gap.

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 well-structured and front-loaded with the core purpose, followed by clear sections for arguments and returns. Every sentence earns its place: the first states the action, and the subsequent lines efficiently document parameters and output without redundancy or fluff.

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?

Given the tool's moderate complexity (3 parameters, mutation operation) and the presence of an output schema (which covers return values), the description is partially complete. It explains parameters well but lacks behavioral context like auth needs or error handling. With no annotations, it should do more to compensate, making it adequate but with clear gaps.

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?

Schema description coverage is 0%, so the description must compensate. It adds meaningful context for all three parameters: 'to' is clarified as 'Phone number or WhatsApp ID', 'audio' as 'Audio URL or media ID', and 'reply_to_message_id' as 'Message ID to reply to'. This goes beyond the schema's bare titles, though it could provide more detail on formats or constraints (e.g., URL requirements).

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 tool's purpose with a specific verb ('send') and resource ('audio message'), making it immediately understandable. However, it doesn't explicitly differentiate this from sibling tools like send_message, send_video, or send_document, which all share the 'send' pattern but with different media types.

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. With multiple sibling tools for sending different media types (e.g., send_message, send_image, send_video), there's no indication of when an audio message is preferred or what contexts it's suited for, leaving the agent to guess based on parameter names alone.

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/Jem-HR/pywa-mcp-server'

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