Skip to main content
Glama
Sealjay

mcp-hey

hey_remove_label

Remove a label from an email thread. Idempotent — no error if the label is not currently applied. Use hey_list_labels to discover label IDs.

Instructions

Remove a label from an email thread. Idempotent — no error if the label is not currently applied. Returns {success, error?}. Use hey_list_labels to discover available label IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topic_idYesThe topic/thread ID to unlabel
label_idYesThe label ID to remove

Implementation Reference

  • src/index.ts:439-457 (registration)
    Tool schema registration for 'hey_remove_label' — defines name, description, and inputSchema with topic_id and label_id required parameters.
    {
      name: "hey_remove_label",
      description:
        "Remove a label from an email thread. Idempotent — no error if the label is not currently applied. Returns {success, error?}. Use hey_list_labels to discover available label IDs.",
      inputSchema: {
        type: "object" as const,
        properties: {
          topic_id: {
            type: "string",
            description: "The topic/thread ID to unlabel",
          },
          label_id: {
            type: "string",
            description: "The label ID to remove",
          },
        },
        required: ["topic_id", "label_id"],
      },
    },
  • Handler case in the switch statement for 'hey_remove_label' — validates topic_id and label_id, then calls the removeLabel function.
    case "hey_remove_label": {
      const topicId = validateId(args?.topic_id)
      const labelId = validateId(args?.label_id)
      if (!topicId) {
        return {
          content: [
            {
              type: "text",
              text: "Error: topic_id is required and must be valid",
            },
          ],
          isError: true,
        }
      }
      if (!labelId) {
        return {
          content: [
            {
              type: "text",
              text: "Error: label_id is required and must be valid",
            },
          ],
          isError: true,
        }
      }
      result = await removeLabel(topicId, labelId)
      break
    }
  • The removeLabel function implementation — sends a DELETE request to /topics/{topicId}/filings?folder_id={labelId} to remove a label from an email thread.
    export async function removeLabel(
      topicId: string,
      labelId: string,
    ): Promise<OrganiseResult> {
      if (!topicId) {
        return { success: false, error: "Topic ID is required" }
      }
      if (!labelId) {
        return { success: false, error: "Label ID is required" }
      }
    
      try {
        const response = await withCsrfRetry(() =>
          heyClient.delete(`/topics/${topicId}/filings?folder_id=${labelId}`),
        )
    
        return organiseResponseToResult(response, () =>
          invalidateForAction("label", topicId),
        )
      } catch (err) {
        return { success: false, error: toUserError(err) }
      }
    }
  • src/index.ts:36-37 (registration)
    Import of the removeLabel function from src/tools/organise.ts into the main server.
    removeLabel,
    replyLater,
Behavior4/5

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

With no annotations, the description discloses idempotent behavior and the return format ({success, error?}). It does not mention authentication or side effects, but for a simple removal operation, the disclosure is fairly transparent.

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, using two sentences to convey purpose, idempotency, return, and a helpful sibling reference. 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 tool with full schema coverage and no output schema, the description is nearly complete. It covers what, idempotency, return, and label discovery. Minor gap: no detail on error conditions beyond 'error?'.

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 defines both parameters clearly. The description adds no extra meaning beyond what the schema provides, meeting the baseline of 3.

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 ('Remove a label from an email thread') and resource, with specific verb and resource. It distinguishes from sibling tools by implying the opposite of 'hey_add_label' and referencing 'hey_list_labels' for label discovery.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains idempotency (safe to call even if label not applied) and directs users to 'hey_list_labels' for finding label IDs. However, it does not explicitly state when not to use this tool (e.g., to add a label), though that is implied by the sibling context.

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/Sealjay/mcp-hey'

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