get_media
Download images, videos, audio, or documents from a specific WhatsApp message using its message ID and session ID.
Instructions
Download media (image, video, audio, document) from a received WhatsApp message by its message ID
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sessionId": "<sessionId>",
"messageId": "<messageId>"
},
"name": "get_media"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | Session ID | |
| messageId | Yes | Message ID containing the media |
Implementation Reference
- src/tools/media.ts:6-19 (registration)Registration of get_media tool with input schema (sessionId, messageId) and handler that calls OpenWA API
server.registerTool( "get_media", { description: "Download media (image, video, audio, document) from a received WhatsApp message by its message ID", inputSchema: { sessionId: z.string().describe("Session ID"), messageId: z.string().describe("Message ID containing the media"), }, }, async ({ sessionId, messageId }) => { const data = await openwaClient({ method: "GET", path: `/sessions/${sessionId}/media/${messageId}` }); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } );