get_email_templates
Browse available email templates for sending proposals to clients. Find pre-built formats to communicate your business offers effectively.
Instructions
Lists available email templates which are used to send proposals
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- Full tool definition including name, description, parameters, annotations, and the execute handler that fetches and validates email templates from the API.export const getEmailTemplatesTool: Tool<undefined, typeof parameters> = { name: 'get_email_templates', description: 'Lists available email templates which are used to send proposals', parameters, annotations: { title: 'Get Email Templates', openWorldHint: true, }, async execute() { const result = await get('/settings/email-templates'); const parsed = emailTemplatesSchema.safeParse(result); if (!parsed.success) { throwApiInvalidResponseError(parsed.error); } return JSON.stringify(parsed.data); }, };
- src/schemas/settings.ts:12-19 (schema)Zod schemas defining the structure of an email template (id and name) and array of templates, used for parsing the API response.export const emailTemplateSchema = z .object({ id: z.number(), name: z.string(), }) .passthrough(); export const emailTemplatesSchema = z.array(emailTemplateSchema);
- src/tools/register.ts:7-7 (registration)Import of the getEmailTemplatesTool for registration.import { getEmailTemplatesTool } from './settings/get-email-templates.js';
- src/tools/register.ts:25-25 (registration)Inclusion of getEmailTemplatesTool in the array of tools to be registered with the MCP server.getEmailTemplatesTool,
- src/tools/register.ts:37-39 (registration)Registration function that adds all tools, including getEmailTemplatesTool, to the FastMCP server.export function registerTools({ server }: { server: FastMCP }) { (tools as unknown as FastMCPTool<Record<string, unknown>, ToolParameters>[]).map(initialContextGuard).forEach((tool) => server.addTool(tool)); }