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
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) }] }; } );