Skip to main content
Glama
rishipradeep-think41

Google Workspace MCP Server

send_email

Send emails programmatically using the Gmail API. Specify recipients, subject, and content, including HTML. Manage CC and BCC fields for efficient email distribution.

Instructions

Send a new email

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bccNoBCC recipients (comma-separated)
bodyYesEmail body (can include HTML)
ccNoCC recipients (comma-separated)
subjectYesEmail subject
toYesRecipient email address

Implementation Reference

  • The handler function that parses arguments, constructs a raw base64url-encoded email message with headers and body, and sends it using the Gmail API.
    private async handleSendEmail(args: any) {
      try {
        const { to, subject, body, cc, bcc } = args;
    
        const headers = [
          'Content-Type: text/plain; charset="UTF-8"',
          "MIME-Version: 1.0",
          `To: ${to}`,
          cc ? `Cc: ${cc}` : null,
          bcc ? `Bcc: ${bcc}` : null,
          `Subject: ${subject}`,
        ]
          .filter(Boolean)
          .join("\r\n");
    
        // Ensure proper separation between headers and body
        const email = `${headers}\r\n\r\n${body}`;
    
        // Encode in base64url
        const encodedMessage = Buffer.from(email)
          .toString("base64")
          .replace(/\+/g, "-")
          .replace(/\//g, "_")
          .replace(/=+$/, "");
    
        // Send the email
        const response = await this.gmail.users.messages.send({
          userId: "me",
          requestBody: {
            raw: encodedMessage,
          },
        });
    
        return {
          content: [
            {
              type: "text",
              text: `Email sent successfully. Message ID: ${response.data.id}`,
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: "text",
              text: `Error sending email: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
    }
  • The input schema and metadata for the send_email tool, specifying required parameters to, subject, body and optional cc, bcc.
    {
      name: "send_email",
      description: "Send a new email",
      inputSchema: {
        type: "object",
        properties: {
          to: {
            type: "string",
            description: "Recipient email address",
          },
          subject: {
            type: "string",
            description: "Email subject",
          },
          body: {
            type: "string",
            description: "Email body (can include HTML)",
          },
          cc: {
            type: "string",
            description: "CC recipients (comma-separated)",
          },
          bcc: {
            type: "string",
            description: "BCC recipients (comma-separated)",
          },
        },
        required: ["to", "subject", "body"],
      },
    },
  • src/index.ts:278-279 (registration)
    Registration in the CallToolRequestHandler switch statement, dispatching send_email calls to the handleSendEmail method.
    case "send_email":
      return await this.handleSendEmail(request.params.arguments);
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. 'Send a new email' implies a write operation but doesn't specify critical behaviors: whether it requires authentication, has rate limits, supports attachments, confirms delivery, or handles errors. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 three words, with no wasted language. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place by conveying essential purpose without redundancy.

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 the tool's complexity (a write operation with 5 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like side effects, error handling, or return values, which are crucial for an agent to use the tool effectively. The high schema coverage helps with inputs but doesn't compensate for these gaps.

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?

Schema description coverage is 100%, meaning all parameters (to, subject, body, cc, bcc) are documented in the schema. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints. This meets the baseline of 3 for high schema coverage, but doesn't compensate with extra value.

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 'Send a new email' clearly states the action (send) and resource (email), with 'new' distinguishing it from modifying existing emails. However, it doesn't explicitly differentiate from sibling tools like 'modify_email' or 'list_emails', which would require more specific language about creating versus updating versus reading emails.

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 prerequisites (e.g., needing recipient addresses), exclusions (e.g., not for bulk sends), or comparisons to siblings like 'modify_email' for editing existing emails or 'list_emails' for viewing emails. This leaves the agent with minimal context for tool selection.

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

Related 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/rishipradeep-think41/gsuite-mcp'

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