Skip to main content
Glama

delete_inbox

Removes an email inbox and permanently deletes all its messages.

Instructions

Delete an inbox and all its messages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inbox_idYesInbox ID to delete

Implementation Reference

  • MCP tool handler for 'delete_inbox'. Defines the tool with server.tool(), takes an inbox_id parameter, calls the REST API DELETE endpoint, and resets the default inbox cache on success.
    server.tool(
      'delete_inbox',
      'Delete an inbox and all its messages',
      { inbox_id: idSchema.describe('Inbox ID to delete') },
      async ({ inbox_id }) => {
        const result = await api('DELETE', `/v1/inboxes/${inbox_id}`);
        if (!result.error) _defaultInbox = null; // reset cache
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
      }
    );
  • mcp/index.js:259-268 (registration)
    Tool registration using server.tool() with the name 'delete_inbox' and a Zod schema for inbox_id.
    server.tool(
      'delete_inbox',
      'Delete an inbox and all its messages',
      { inbox_id: idSchema.describe('Inbox ID to delete') },
      async ({ inbox_id }) => {
        const result = await api('DELETE', `/v1/inboxes/${inbox_id}`);
        if (!result.error) _defaultInbox = null; // reset cache
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
      }
    );
  • Input schema for the delete_inbox tool: inbox_id (number or numeric string) validated by idSchema.
    { inbox_id: idSchema.describe('Inbox ID to delete') },
  • Database-level deleteInbox function. Deletes all messages associated with the inbox, then deletes the inbox row itself, restricted by user_id.
    export function deleteInbox(id, userId) {
      db.run('DELETE FROM emails WHERE inbox_id = ?', [id]);
      db.run('DELETE FROM inboxes WHERE id = ? AND user_id = ?', [id, userId]);
      saveDb();
    }
  • REST API endpoint (DELETE /v1/inboxes/:id) that calls deleteInbox from db.js after verifying the inbox exists and belongs to the user.
    app.delete('/v1/inboxes/:id', (req, res) => {
      try {
        const inbox = getInboxById(req.params.id, req.user.id);
        if (!inbox) return res.status(404).json({ error: 'Inbox not found' });
        deleteInbox(req.params.id, req.user.id);
        res.json({ success: true });
      } catch (err) {
        res.status(500).json({ error: err.message });
      }
    });
Behavior3/5

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

The description indicates the destructive nature (deletion) but lacks details on irreversibility or side effects. With no annotations, it provides minimal but adequate 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?

A single, direct sentence that efficiently conveys the tool's action with no unnecessary words.

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?

For a simple delete tool with one parameter and no output schema, the description is sufficiently complete, though it could mention irreversibility for completeness.

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 single parameter is fully described in the schema (100% coverage); the description adds no additional meaning or constraints beyond the schema.

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 verb 'delete' and the resource 'inbox', and specifies the scope 'and all its messages', distinguishing it from other inbox-related tools.

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?

No guidance on when to use or not use this tool, no mention of alternatives or prerequisites, leaving the agent without context for decision-making.

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/joansongjr/clawaimail'

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