list_single_sends
Retrieve and manage all single send email campaigns from SendGrid to review, analyze, or organize your marketing communications.
Instructions
List all single send campaigns
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_size | No | Number of results to return |
Implementation Reference
- src/tools/campaigns.ts:14-17 (handler)The handler function that executes the list_single_sends tool logic by querying the SendGrid API for single send campaigns.handler: async ({ page_size }: { page_size: number }): Promise<ToolResult> => { const result = await makeRequest(`https://api.sendgrid.com/v3/marketing/singlesends/search?page_size=${page_size}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; },
- src/tools/campaigns.ts:7-13 (schema)The tool configuration including input schema using Zod for validation.config: { title: "List Single Send Campaigns", description: "List all single send campaigns", inputSchema: { page_size: z.number().optional().default(50).describe("Number of results to return"), }, },
- src/index.ts:21-23 (registration)Registration of all tools, including 'list_single_sends', via loop over allTools object.for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }
- src/tools/index.ts:2-11 (registration)Import and inclusion of campaignTools (containing list_single_sends) into the allTools export.import { campaignTools } from "./campaigns.js"; import { contactTools } from "./contacts.js"; import { mailTools } from "./mail.js"; import { miscTools } from "./misc.js"; import { statsTools } from "./stats.js"; import { templateTools } from "./templates.js"; export const allTools = { ...automationTools, ...campaignTools,