Skip to main content
Glama

delete_message

Permanently delete a Gmail message by its ID to remove unwanted emails and manage inbox content.

Instructions

Immediately and permanently delete a message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the message to delete

Implementation Reference

  • Handler function for the delete_message tool. It uses the shared handleTool wrapper to authenticate and call the Gmail API's users.messages.delete method with the provided message ID.
    async (params) => {
      return handleTool(config, async (gmail: gmail_v1.Gmail) => {
        const { data } = await gmail.users.messages.delete({ userId: 'me', id: params.id })
        return formatResponse(data)
      })
    }
  • Input schema for delete_message tool, defining the required 'id' parameter as a string.
    {
      id: z.string().describe("The ID of the message to delete")
    },
  • src/index.ts:562-573 (registration)
    Registration of the delete_message tool on the MCP server, specifying name, description, input schema, and handler function.
    server.tool("delete_message",
      "Immediately and permanently delete a message",
      {
        id: z.string().describe("The ID of the message to delete")
      },
      async (params) => {
        return handleTool(config, async (gmail: gmail_v1.Gmail) => {
          const { data } = await gmail.users.messages.delete({ userId: 'me', id: params.id })
          return formatResponse(data)
        })
      }
    )
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'immediately and permanently delete', which implies a destructive, irreversible action, but does not cover other critical aspects such as required permissions, error conditions (e.g., if the message doesn't exist), or rate limits. This leaves significant gaps for a mutation 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, efficient sentence that front-loads the key information ('Immediately and permanently delete a message') with no wasted words. It is appropriately sized for a simple tool with one parameter.

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 the tool's complexity (a destructive mutation with no annotations and no output schema), the description is minimally adequate but incomplete. It covers the action and permanence but lacks details on permissions, error handling, or return values, which are important for safe usage. However, the high schema coverage for the single parameter helps offset some gaps.

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 100% description coverage, with the single parameter 'id' clearly documented as 'The ID of the message to delete'. The description does not add further parameter details, which is acceptable given the high schema coverage, but it also doesn't compensate for any gaps (there are none). With zero parameters needing extra explanation, a baseline of 4 is appropriate.

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 action ('delete'), the resource ('a message'), and the manner ('immediately and permanently'), which is specific and distinguishes it from sibling tools like 'trash_message' (which likely moves to trash rather than permanent deletion) and 'batch_delete_messages' (which handles multiple messages).

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 like 'trash_message' or 'batch_delete_messages', nor does it mention any prerequisites or constraints (e.g., permissions needed, recoverability). It only describes what the tool does, not when it should be applied.

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

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