Skip to main content
Glama
SymbolStar

gmail-mcp

by SymbolStar

get_email

Fetch a specific Gmail email by providing its message ID. Get full message content and metadata.

Instructions

Read one Gmail message by messageId.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageIdYesGmail message id.

Implementation Reference

  • Handler function that fetches a full Gmail message by ID using format 'full' and converts it to EmailDetail.
    export async function getEmail(messageId: string): Promise<EmailDetail> {
      const gmail = await getGmailClient();
      const response = await gmail.users.messages.get({
        userId: USER_ID,
        id: messageId,
        format: "full",
      });
    
      return toEmailDetail(response.data);
    }
  • Schema/type definition for the EmailDetail return type of getEmail.
    export type EmailDetail = EmailSummary & {
      cc?: string;
      bcc?: string;
      bodyText?: string;
      bodyHtml?: string;
      attachments: Array<{
        filename: string;
        mimeType?: string | null;
        attachmentId?: string;
        size?: number | null;
      }>;
      internalDate?: string | null;
    };
  • src/index.ts:36-43 (registration)
    Registration of the 'get_email' tool with the MCP server, including its Zod schema for messageId input.
    server.tool(
      "get_email",
      "Read one Gmail message by messageId.",
      {
        messageId: z.string().min(1).describe("Gmail message id."),
      },
      async ({ messageId }) => jsonResult(await getEmail(messageId)),
    );
Behavior3/5

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

No annotations are provided, so the description must disclose behavioral traits. It states 'Read,' which implies a read-only operation with no side effects, but does not detail error handling, permissions required, or what the response contains. This is minimally adequate for a simple read tool.

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, well-structured sentence with no unnecessary words. It is front-loaded with the verb and resource, making it efficient for an agent to parse.

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?

Given the tool's simplicity (one parameter, no output schema), the description is largely complete. It could be improved by briefly noting what the tool returns (e.g., message content or metadata), but it still provides enough context for basic usage.

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

Parameters3/5

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

The input schema has 100% description coverage for the single parameter (messageId: 'Gmail message id.'). The description adds no further meaning beyond what the schema already provides, so it meets the baseline of 3.

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 uses the specific verb 'Read' and clearly identifies the resource as 'one Gmail message by messageId.' It distinguishes from siblings like list_emails (list multiple) and search_emails (search), making the tool's purpose unambiguous.

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

Usage Guidelines3/5

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

The description implies that the tool is used when you have a specific messageId, but it does not explicitly state when to use it versus alternatives (e.g., list_emails for browsing, search_emails for filtering). No exclusions or prerequisites are mentioned.

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/SymbolStar/gmail-mcp'

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