Skip to main content
Glama
erickva

Google Calendar - No deletion

by erickva

modify_email

Adjust email labels such as archive, trash, and read/unread status. Manage email organization by adding or removing labels using a specified email ID.

Instructions

Modify email labels (archive, trash, mark read/unread)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addLabelsNoLabels to add
idYesEmail ID
removeLabelsNoLabels to remove

Implementation Reference

  • The main handler function that modifies an email's labels by adding or removing specified labels using the Gmail API.
    private async handleModifyEmail(args: any) {
      try {
        const { id, addLabels = [], removeLabels = [] } = args;
    
        const response = await this.gmail.users.messages.modify({
          userId: 'me',
          id,
          requestBody: {
            addLabelIds: addLabels,
            removeLabelIds: removeLabels,
          },
        });
    
        return {
          content: [
            {
              type: 'text',
              text: `Email modified successfully. Updated labels for message ID: ${response.data.id}`,
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: `Error modifying email: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Defines the input schema for the modify_email tool, specifying parameters like id (required), addLabels, and removeLabels.
    inputSchema: {
      type: 'object',
      properties: {
        id: {
          type: 'string',
          description: 'Email ID',
        },
        addLabels: {
          type: 'array',
          items: { type: 'string' },
          description: 'Labels to add',
        },
        removeLabels: {
          type: 'array',
          items: { type: 'string' },
          description: 'Labels to remove',
        },
      },
      required: ['id']
    },
  • src/index.ts:128-151 (registration)
    Registers the modify_email tool in the list of available tools returned by ListToolsRequest.
    {
      name: 'modify_email',
      description: 'Modify email labels (archive, trash, mark read/unread)',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'Email ID',
          },
          addLabels: {
            type: 'array',
            items: { type: 'string' },
            description: 'Labels to add',
          },
          removeLabels: {
            type: 'array',
            items: { type: 'string' },
            description: 'Labels to remove',
          },
        },
        required: ['id']
      },
    },
  • src/index.ts:236-237 (registration)
    Registers the handler for the modify_email tool in the CallToolRequest switch statement.
    case 'modify_email':
      return await this.handleModifyEmail(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. It implies a mutation operation ('Modify') but doesn't specify permissions required, whether changes are reversible, rate limits, or error conditions. The mention of actions like 'archive' and 'trash' hints at destructive behavior, but this isn't explicitly stated, leaving significant gaps.

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 core purpose ('Modify email labels') and lists specific actions without unnecessary words. Every part 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.

Completeness2/5

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

Given the complexity of a mutation tool with no annotations and no output schema, the description is insufficient. It lacks details on behavioral traits (e.g., side effects, permissions), usage context, and expected outcomes, leaving the agent poorly equipped to handle this tool effectively in real-world scenarios.

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%, so the schema already documents all parameters (id, addLabels, removeLabels). The description adds minimal value by implying label types (e.g., 'archive', 'trash') but doesn't provide syntax details or examples beyond what the schema offers. This meets the baseline for high schema coverage.

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 action ('Modify email labels') and specifies the types of modifications possible (archive, trash, mark read/unread), which distinguishes it from sibling tools like 'send_email' or 'list_emails'. However, it doesn't explicitly mention that it operates on existing emails or differentiate from potential label-specific tools, keeping it from a perfect score.

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 an email ID from 'list_emails' or 'search_emails'), exclusions, or comparisons to other tools like 'create_event' for related actions. This leaves the agent without 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/erickva/google-workspace-mcp-server-no-calendar-deletetion'

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