get_email_templates
Retrieve available email templates for sending proposals in Offorte Proposal Software.
Instructions
Lists available email templates which are used to send proposals
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The async execute() function implements the core logic: fetches email templates from the '/settings/email-templates' API, safely parses the response using emailTemplatesSchema, throws error if invalid, and returns the JSON stringified parsed data.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 schema definitions for a single email template (id and name) and the array of templates, used to validate the API response in the tool handler.export const emailTemplateSchema = z .object({ id: z.number(), name: z.string(), }) .passthrough(); export const emailTemplatesSchema = z.array(emailTemplateSchema);
- src/tools/register.ts:37-39 (registration)The registerTools function adds all tools, including getEmailTemplatesTool (imported and listed in the tools array), to the FastMCP server instance.export function registerTools({ server }: { server: FastMCP }) { (tools as unknown as FastMCPTool<Record<string, unknown>, ToolParameters>[]).map(initialContextGuard).forEach((tool) => server.addTool(tool)); }
- src/tools/register.ts:25-25 (registration)Includes getEmailTemplatesTool in the array of tools to be registered.getEmailTemplatesTool,
- src/tools/register.ts:7-7 (registration)Imports the getEmailTemplatesTool for registration.import { getEmailTemplatesTool } from './settings/get-email-templates.js';