get_template
Retrieve a specific WhatsApp Business message template by ID for use in automated messaging workflows and customer communications.
Instructions
Get a specific template by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| templateId | Yes | Template ID |
Implementation Reference
- src/index.ts:730-743 (handler)Main handler function for the 'get_template' tool. Retrieves the template by ID using templateService and returns it as JSON text content.private async handleGetTemplate(args: any) { const template = templateService.getTemplate(args.templateId); if (!template) { throw new Error(`Template ${args.templateId} not found`); } return { content: [ { type: 'text', text: JSON.stringify(template, null, 2) } ] }; }
- src/index.ts:213-222 (schema)Tool registration in the tools list including input schema definition requiring 'templateId'.name: 'get_template', description: 'Get a specific template by ID', inputSchema: { type: 'object', properties: { templateId: { type: 'string', description: 'Template ID' } }, required: ['templateId'] } },
- src/index.ts:510-511 (registration)Dispatch case in the main CallToolRequestHandler switch statement that routes to the specific handler.case 'get_template': return await this.handleGetTemplate(args);
- Core helper method in templateService that fetches a template from the internal Map by ID.getTemplate(id: string): MessageTemplate | undefined { return this.templates.get(id); }