get_template
Retrieve a SendGrid email template by its ID to reuse content, maintain consistency, and streamline email campaign creation.
Instructions
Retrieve a SendGrid template by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template_id | Yes | ID of the template to retrieve |
Implementation Reference
- src/tools/index.ts:415-417 (handler)Handler logic in handleToolCall function that invokes service.getTemplate with the provided template_id and returns the retrieved template as JSON.case 'get_template': const retrievedTemplate = await service.getTemplate(args.template_id); return { content: [{ type: 'text', text: JSON.stringify(retrievedTemplate, null, 2) }] };
- src/tools/index.ts:156-169 (schema)Tool definition including name, description, and input schema requiring 'template_id' string.{ name: 'get_template', description: 'Retrieve a SendGrid template by ID', inputSchema: { type: 'object', properties: { template_id: { type: 'string', description: 'ID of the template to retrieve' } }, required: ['template_id'] } },
- src/services/sendgrid.ts:215-221 (helper)SendGridService method that performs the API request to retrieve the template by ID.async getTemplate(templateId: string): Promise<SendGridTemplate> { const [response] = await this.client.request({ method: 'GET', url: `/v3/templates/${templateId}` }); return response.body as SendGridTemplate; }