Skip to main content
Glama
Garoth

SendGrid MCP Server

by Garoth

list_contacts

Retrieve all stored contacts from your SendGrid email marketing account to manage your subscriber database and communication lists.

Instructions

List all contacts in your SendGrid account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_contacts' tool in the handleToolCall switch statement. It calls service.listAllContacts() and formats the response as JSON text.
    case 'list_contacts':
      const allContacts = await service.listAllContacts();
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(allContacts.map(c => ({
            email: c.email,
            first_name: c.first_name,
            last_name: c.last_name
          })), null, 2)
        }]
      };
  • The tool schema definition including name, description, and empty inputSchema (no parameters required). Part of getToolDefinitions array used for MCP tool registration.
    {
      name: 'list_contacts',
      description: 'List all contacts in your SendGrid account',
      inputSchema: {
        type: 'object',
        properties: {},
        required: []
      }
    },
  • The SendGridService method listAllContacts() that performs the API call to search and retrieve all contacts.
    async listAllContacts(): Promise<SendGridContact[]> {
      const [response] = await this.client.request({
        method: 'POST',
        url: '/v3/marketing/contacts/search',
        body: {
          query: "email IS NOT NULL" // Get all contacts that have an email
        }
      });
      return (response.body as { result: SendGridContact[] }).result || [];
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it's a list operation but doesn't mention pagination, rate limits, authentication needs, sorting, or what fields are returned. For a tool that likely returns multiple items, this leaves critical behavioral aspects unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states exactly what the tool does with zero wasted words. It's appropriately sized for a simple list operation and front-loads the core functionality. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a list operation. It doesn't explain what data is returned, how results are structured, or any behavioral constraints like pagination or limits. For a tool that likely returns complex contact data, this leaves the agent with significant gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so there are no parameters to document. The description correctly reflects this by not mentioning any parameters. This meets the baseline for tools with no parameters, as there's nothing to compensate for.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('contacts in your SendGrid account'), making the purpose immediately understandable. It doesn't explicitly differentiate from siblings like 'get_contacts_by_list' or 'list_contact_lists', but the scope ('all contacts') provides some implicit distinction. This is clear but lacks explicit sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_contacts_by_list' (for filtered listing) and 'list_contact_lists' (for listing lists rather than contacts), the agent receives no help in choosing between them. There's no mention of prerequisites, constraints, or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Garoth/sendgrid-mcp'

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