Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

List Segments

list_segments

Retrieve all email list segments and their parent list relationships for targeted audience management in SendGrid campaigns.

Instructions

List all segments with their parent list relationships

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that fetches all segments from the SendGrid API and returns the JSON response.
    handler: async (): Promise<ToolResult> => {
      const result = await makeRequest("https://api.sendgrid.com/v3/marketing/segments");
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    },
  • Configuration for the list_segments tool, including title and description. No input schema as the tool requires no parameters.
    config: {
      title: "List Segments",
      description: "List all segments with their parent list relationships",
    },
  • Includes contactTools (which contains list_segments) in the allTools object export.
    ...contactTools,
  • src/index.ts:21-23 (registration)
    Loop that registers every tool from allTools, including list_segments, with the MCP server.
    for (const [name, tool] of Object.entries(allTools)) {
      server.registerTool(name, tool.config as any, tool.handler as any);
    }
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 mentions that the tool lists segments 'with their parent list relationships,' which adds some context about the return data structure. However, it doesn't disclose critical behavioral traits such as whether this is a read-only operation, potential rate limits, authentication requirements, pagination behavior, or error conditions. For a tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 front-loads the key information ('List all segments') and adds necessary detail ('with their parent list relationships'). There is zero waste or redundancy, and it's appropriately sized for a simple listing tool. Every word earns its place, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is somewhat complete but has gaps. It specifies what the tool does and the data scope, but without annotations or output schema, it lacks details on behavioral traits (e.g., safety, performance) and return format. For a simple read operation, this is minimally adequate but could be improved with more context about the output or usage scenarios.

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 tool has 0 parameters, and the schema description coverage is 100% (since there are no parameters to describe). According to the rules, for 0 parameters, the baseline score is 4. The description doesn't need to compensate for any parameter gaps, and it appropriately doesn't discuss parameters, so it meets the expected standard.

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 ('segments'), and specifies the scope ('all segments with their parent list relationships'). It distinguishes this tool from other list operations like list_contacts or list_email_lists by focusing specifically on segments and their relationships. However, it doesn't explicitly differentiate from sibling tools like get_category_stats or search_contacts, which is why it doesn't reach a perfect 5.

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. It doesn't mention when this tool is appropriate (e.g., for retrieving segment metadata vs. actual contact data) or when to use other tools like list_contacts or search_contacts. There's no explicit context, exclusions, or alternatives provided, leaving usage entirely implied.

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

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