Skip to main content
Glama
Karopatu

Email Management MCP Server

by Karopatu

Send Email

send-email

Send emails with subject, recipient, and body content through the Email Management MCP Server.

Instructions

Send Email with subject, destination and body

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesDestination email
subjectYesEmail subject, min 1 char and max 30 chars
bodyYesEmail body, min 1 char and max 255 chars

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
successYes

Implementation Reference

  • Handler function registered for the 'send-email' tool. It constructs auth from headers, instantiates EmailClient, calls sendEmail, and returns structured response with success/error.
    async (params, {requestInfo}) => {
      const authEmail = {
        port: requestInfo?.headers["email-port"],
        email: requestInfo?.headers["email-username"],
        password: requestInfo?.headers["email-password"],
        clientType: requestInfo?.headers["email-client-type"],
      } as AuthEmailType;
    
    
      const emailClient = new EmailClient (authEmail);
    
      const result = await emailClient.sendEmail(params);
    
      const response = {
        success: result,
        error: result ? null : "No hay conexión con el servidor"
      }
    
      return {
        isError: !result,
        content: [
          {
            type: "text",
            text: JSON.stringify(response)
          },
        ],
        structuredContent: response,
      };
  • Zod input schema (SendEmailSchema) defining parameters for send-email tool: to, subject, body with validations.
    export const SendEmailSchema = z.object({
      to: z.string().email().describe('Destination email'),
      subject: z.
      string()
      .min(1)
      .max(30)
      .describe('Email subject, min 1 char and max 30 chars'), 
      body: z.
      string()
      .min(1)
      .max(255).
      describe('Email body, min 1 char and max 255 chars'),
    })
    
    export type SendEmailType = z.infer<typeof SendEmailSchema>;
  • Zod output schema (OutputSendEmailSchema) for send-email tool response: success boolean and optional error string.
    export const OutputSendEmailSchema = z.object({
      success: z.boolean(),
      error: z.string().nullish(),
    });
    export type OutputSendEmailType = z.infer<typeof OutputSendEmailSchema>;
  • MCP tool registration call for 'send-email' specifying title, description, annotations, input/output schemas, and handler function.
    server.registerTool(  
      "send-email",
      {
        title: "Send Email",
        description: "Send Email with subject, destination and body",
        annotations: {
          openWorlHint: true,
          examples: {
            input: {
              to: "example@domain.com",
              subject: "Example Subject",
              body: "Example Body",
            },
          },
        },
        inputSchema: SendEmailSchema.shape,
        outputSchema: OutputSendEmailSchema.shape,
      }, 
      async (params, {requestInfo}) => {
        const authEmail = {
          port: requestInfo?.headers["email-port"],
          email: requestInfo?.headers["email-username"],
          password: requestInfo?.headers["email-password"],
          clientType: requestInfo?.headers["email-client-type"],
        } as AuthEmailType;
    
    
        const emailClient = new EmailClient (authEmail);
    
        const result = await emailClient.sendEmail(params);
    
        const response = {
          success: result,
          error: result ? null : "No hay conexión con el servidor"
        }
    
        return {
          isError: !result,
          content: [
            {
              type: "text",
              text: JSON.stringify(response)
            },
          ],
          structuredContent: response,
        };
    
        });  
  • Supporting method in EmailClient class that implements the email sending logic (mock implementation using random success). Called by the tool handler.
    sendEmail(params: SendEmailType) {
      const randonNumber = Math.random();
    
       Logger.info ("Send email", params);
    
      return randonNumber > 0.15;
    } 
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Send Email' implies a write/mutation operation, the description doesn't disclose important behavioral traits like authentication requirements, rate limits, delivery confirmation, error handling, or whether this is a synchronous or asynchronous operation.

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 extremely concise at just 6 words, front-loading the core action and parameters with zero wasted words. Every element in the description serves a purpose, making it highly efficient.

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 this is a mutation tool with no annotations but with a complete input schema and output schema available, the description is minimally adequate. However, for an email sending operation that likely has important behavioral considerations (delivery, errors, authentication), the description should provide more context about what happens when the tool is invoked.

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 description mentions the three parameters (subject, destination, body) but adds no semantic meaning beyond what's already fully documented in the input schema (100% coverage). The schema already provides format validation, length constraints, and clear descriptions for each parameter.

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 ('Send') and resource ('Email') along with the key parameters (subject, destination, body). It's specific about what the tool does but doesn't distinguish it from its sibling 'fetch-emails' beyond the obvious action difference.

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 the sibling 'fetch-emails' or provide any context about appropriate use cases, prerequisites, or limitations for sending emails.

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/Karopatu/email-management-mcp'

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