Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

Get Scopes

get_scopes

Retrieve available permission scopes for SendGrid API keys to understand access privileges and configure secure integrations.

Instructions

Get available permission scopes for API keys

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the get_scopes tool logic. It makes a GET request to the SendGrid API endpoint /v3/scopes and returns the available permission scopes as formatted JSON.
    get_scopes: {
      config: {
        title: "Get Scopes",
        description: "Get available permission scopes for API keys",
      },
      handler: async (): Promise<ToolResult> => {
        const result = await makeRequest("https://api.sendgrid.com/v3/scopes");
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      },
    },
  • The tool configuration/schema defining its title and description. No input arguments are required; it takes no parameters.
    config: {
      title: "Get Scopes",
      description: "Get available permission scopes for API keys",
    },
  • src/index.ts:21-23 (registration)
    The registration loop where the get_scopes tool (along with all other tools) is registered with the MCP server. The tool name 'get_scopes' is derived from its object key.
    for (const [name, tool] of Object.entries(allTools)) {
      server.registerTool(name, tool.config as any, tool.handler as any);
    }
  • The helper makeRequest function called by the handler to perform the HTTP request to the SendGrid API. It attaches auth headers, checks for errors, and parses the JSON response.
    export async function makeRequest(url: string, options: RequestInit = {}): Promise<any> {
      const response = await fetch(url, {
        headers: {
          ...getAuthHeaders(),
          ...options.headers,
        },
        ...options,
      });
    
      if (!response.ok) {
        const errorText = await response.text();
        throw new Error(`SendGrid API error (${response.status}): ${errorText}`);
      }
    
      return response.json();
    }
Behavior1/5

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

No annotations are provided, and the description does not disclose behavioral traits such as side effects, authentication needs, rate limits, or return format. For a tool with no annotations, the description fails to add behavioral context.

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?

A single, clear sentence with no superfluous words. Front-loaded and appropriately sized for a simple tool.

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

Completeness4/5

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

For a parameterless tool with no output schema, the description is mostly complete. However, it could mention what the scopes represent or how they are structured, but the current level is adequate.

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 no parameters, so schema coverage is 100% trivially. The description adds no parameter info, but with zero parameters there is no need. Baseline 4 applies as per rules.

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

Purpose5/5

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

The description clearly states the tool retrieves available permission scopes for API keys, using a specific verb (Get) and resource (scopes). It is distinct from sibling tools which deal with other entities.

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?

No guidance on when to use this tool versus alternatives. It does not specify prerequisites, contexts, or any exclusions. The description is purely functional.

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