Skip to main content
Glama

update_label

Modify existing Gmail labels by changing their name, visibility settings, or color scheme to better organize your email inbox.

Instructions

Update an existing label

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the label to update
nameNoThe display name of the label
messageListVisibilityNoThe visibility of messages with this label in the message list
labelListVisibilityNoThe visibility of the label in the label list
colorNoThe color settings for the label

Implementation Reference

  • Handler function that destructures params to extract id and labelData, then uses handleTool to call Gmail API users.labels.update and formats the response.
    async (params) => {
      const { id, ...labelData } = params
      return handleTool(config, async (gmail: gmail_v1.Gmail) => {
        const { data } = await gmail.users.labels.update({ userId: 'me', id, requestBody: labelData })
        return formatResponse(data)
      })
    }
  • Input schema using Zod for validating parameters: required 'id', optional 'name', 'messageListVisibility', 'labelListVisibility', and 'color' object.
    {
      id: z.string().describe("The ID of the label to update"),
      name: z.string().optional().describe("The display name of the label"),
      messageListVisibility: z.enum(['show', 'hide']).optional().describe("The visibility of messages with this label in the message list"),
      labelListVisibility: z.enum(['labelShow', 'labelShowIfUnread', 'labelHide']).optional().describe("The visibility of the label in the label list"),
      color: z.object({
        textColor: z.string().describe("The text color of the label as hex string"),
        backgroundColor: z.string().describe("The background color of the label as hex string")
      }).optional().describe("The color settings for the label")
    },
  • src/index.ts:499-518 (registration)
    MCP server tool registration for 'update_label', including description, input schema, and handler function.
    server.tool("update_label",
      "Update an existing label",
      {
        id: z.string().describe("The ID of the label to update"),
        name: z.string().optional().describe("The display name of the label"),
        messageListVisibility: z.enum(['show', 'hide']).optional().describe("The visibility of messages with this label in the message list"),
        labelListVisibility: z.enum(['labelShow', 'labelShowIfUnread', 'labelHide']).optional().describe("The visibility of the label in the label list"),
        color: z.object({
          textColor: z.string().describe("The text color of the label as hex string"),
          backgroundColor: z.string().describe("The background color of the label as hex string")
        }).optional().describe("The color settings for the label")
      },
      async (params) => {
        const { id, ...labelData } = params
        return handleTool(config, async (gmail: gmail_v1.Gmail) => {
          const { data } = await gmail.users.labels.update({ userId: 'me', id, requestBody: labelData })
          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 full burden. 'Update an existing label' implies a mutation operation but doesn't disclose behavioral traits like required permissions, whether changes are reversible, rate limits, or error conditions. 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 a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, though it could benefit from additional context—this score reflects conciseness, not completeness.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects, usage context, or return values, leaving gaps that could hinder an agent's ability to invoke it correctly. The high schema coverage doesn't compensate for missing operational context.

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 fully documents all 5 parameters. The description adds no meaning beyond what the schema provides—it doesn't explain parameter interactions, defaults, or examples. Baseline 3 is appropriate when the schema does all the work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Update an existing label' clearly states the verb ('update') and resource ('label'), but it's vague about what aspects can be updated and doesn't distinguish it from the sibling 'patch_label' tool. It provides basic purpose but lacks specificity about scope or differentiation from alternatives.

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 'patch_label' or 'create_label'. There's no mention of prerequisites, use cases, or exclusions, leaving the agent with no contextual decision-making help.

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

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