list_automations
Retrieve all marketing automations from SendGrid to manage email workflows, campaigns, and automated sequences.
Instructions
List all marketing automations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | No | Pagination offset | |
| limit | No | Number of results to return |
Implementation Reference
- src/tools/automations.ts:15-18 (handler)The handler function that executes the tool logic by querying the SendGrid API for marketing automations with pagination parameters.handler: async ({ offset, limit }: { offset: number; limit: number }): Promise<ToolResult> => { const result = await makeRequest(`https://api.sendgrid.com/v3/marketing/automations?offset=${offset}&limit=${limit}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; },
- src/tools/automations.ts:7-14 (schema)Tool configuration including title, description, and input schema for pagination (offset and limit).config: { title: "List Marketing Automations", description: "List all marketing automations", inputSchema: { offset: PaginationSchema.offset, limit: PaginationSchema.limit, }, },
- src/tools/index.ts:1-10 (registration)Imports automationTools and spreads it into the allTools export, aggregating tools for registration.import { automationTools } from "./automations.js"; 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,
- src/index.ts:20-22 (registration)Registers all tools (including list_automations) with the MCP server using server.registerTool.// Register all tools for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any);