Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

get_contact

Retrieve detailed contact information from SendGrid using the contact ID to access email marketing data and manage subscriber profiles.

Instructions

Get detailed information about a specific contact by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contact_idYesID of the contact to retrieve

Implementation Reference

  • The handler function that performs a GET request to the SendGrid API to retrieve detailed contact information by ID and returns it as formatted JSON.
    handler: async ({ contact_id }: { contact_id: string }): Promise<ToolResult> => { const result = await makeRequest(`https://api.sendgrid.com/v3/marketing/contacts/${contact_id}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; },
  • Tool configuration defining title, description, and input schema (Zod validation for required contact_id string).
    config: { title: "Get Contact Details", description: "Get detailed information about a specific contact by ID", inputSchema: { contact_id: z.string().describe("ID of the contact to retrieve"), }, },
  • Aggregates contactTools (containing get_contact) with other toolsets into the allTools object used for MCP registration.
    export const allTools = { ...automationTools, ...campaignTools, ...contactTools, ...mailTools, ...miscTools, ...statsTools, ...templateTools, };
  • src/index.ts:21-23 (registration)
    Registers all tools from allTools, including get_contact, with the MCP server using registerTool(name, config, handler).
    for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/deyikong/sendgrid-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server