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

send_image

Send images via WhatsApp with optional captions, footers, and reply functionality using the PyWA MCP Server.

Instructions

Send an image message.

Args: to: Phone number or WhatsApp ID image: Image URL or media ID caption: Optional image caption footer: Optional footer text reply_to_message_id: Message ID to reply to

Returns: Dictionary with success status and message ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYes
imageYes
captionNo
footerNo
reply_to_message_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The send_image tool handler function - implements the core logic for sending image messages to WhatsApp users. It takes parameters (to, image, caption, footer, reply_to_message_id), calls the WhatsApp client's send_image method, and returns a success status with message ID or error details.
    @mcp.tool()
    async def send_image(
        to: str,
        image: str,
        caption: Optional[str] = None,
        footer: Optional[str] = None,
        *,
        reply_to_message_id: Optional[str] = None,
    ) -> dict:
        """
        Send an image message.
        
        Args:
            to: Phone number or WhatsApp ID
            image: Image URL or media ID
            caption: Optional image caption
            footer: Optional footer text
            reply_to_message_id: Message ID to reply to
        
        Returns:
            Dictionary with success status and message ID
        """
        try:
            result = wa_client.send_image(
                to=to,
                image=image,
                caption=caption,
                footer=footer,
                reply_to_message_id=reply_to_message_id,
            )
            
            logger.info(f"Image 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 image: {str(e)}")
            return {"success": False, "error": str(e)}
  • The send_image tool is registered with MCP using the @mcp.tool() decorator, which exposes it as an available tool in the Model Context Protocol server.
    @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 full burden. It states the action ('send') but doesn't disclose behavioral traits like whether this requires authentication, has rate limits, what happens on failure, or if it's idempotent. The description is minimal and lacks crucial operational context for a messaging 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 efficiently structured: a clear purpose statement followed by organized Args and Returns sections. Every sentence earns its place—no fluff or repetition. It's front-loaded with the core function and uses bullet-like clarity for parameters.

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 no annotations and an output schema (implied by Returns), the description is partially complete. It covers parameters well and specifies the return format, but lacks behavioral context (e.g., error handling, side effects). For a messaging tool with potential delivery issues, more operational guidance would improve completeness.

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?

With 0% schema description coverage, the description compensates well by explaining all 5 parameters in the Args section. It clarifies semantics: 'to' as phone number or WhatsApp ID, 'image' as URL or media ID, and optional fields like caption and footer. This adds significant value beyond the bare schema, though it could detail format 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: 'Send an image message.' It specifies the verb ('send') and resource ('image message'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like send_video or send_document, which would require mentioning it's specifically for images.

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 siblings like send_message, send_video, and send_document, there's no indication of when an image message is preferred over other message types or what contexts warrant its use. The agent must infer usage from the name 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