Skip to main content
Glama

update_label

Modify an existing label in a GitLab project to change its name, color, description, or priority.

Instructions

Update an existing label in a GitLab project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
nameYes
new_nameNo
colorNo
descriptionNo
priorityNo

Implementation Reference

  • The implementation of the updateLabel function which handles the GitLab API request for updating an existing label.
    export async function updateLabel(
      projectId: string,
      name: string,
      options: {
        new_name?: string;
        color?: string;
        description?: string;
        priority?: number;
      }
    ): Promise<GitLabLabelResponse> {
      if (!projectId?.trim()) {
        throw new Error("Project ID is required");
      }
      if (!name?.trim()) {
        throw new Error("Label name is required");
      }
      if (options.color && !options.color.match(/^#[0-9a-fA-F]{6}$/)) {
        throw new Error("Label color must be a valid hex color (e.g., #ff0000)");
      }
    
      const encodedName = encodeURIComponent(name);
      const endpoint = `/projects/${encodeProjectId(projectId)}/labels/${encodedName}`;
    
      const label = await gitlabPut<GitLabLabelResponse>(endpoint, {
        new_name: options.new_name,
        color: options.color,
        description: options.description,
        priority: options.priority
      });
    
      return GitLabLabelSchema.parse(label);
    }
  • Zod schema for validating the input arguments of the update_label tool.
    export const UpdateLabelSchema = z.object({
      project_id: z.string(),
      name: z.string(), // Current name (identifier)
      new_name: z.string().optional(),
      color: z.string().optional(),
      description: z.string().optional(),
      priority: z.number().optional()
    });
  • src/server.ts:312-317 (registration)
    Tool registration and handler execution logic for update_label in the MCP server.
    case "update_label": {
      const args = UpdateLabelSchema.parse(request.params.arguments);
      const { project_id, name, ...options } = args;
      const label = await api.updateLabel(project_id, name, options);
      return { content: [{ type: "text", text: JSON.stringify(label, null, 2) }] };
    }
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 states it's an update operation, implying mutation, but doesn't cover permissions needed, side effects, error handling, or response format. This leaves significant gaps for a tool with 6 parameters and no output schema.

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, straightforward sentence with no wasted words. It's front-loaded with the core action and resource, making it efficient and easy to parse.

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 (6 parameters, no schema descriptions, no annotations, no output schema), the description is inadequate. It doesn't explain parameter usage, behavioral traits, or output expectations, leaving the agent with insufficient information to invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It only mentions 'label' generically, without explaining what parameters like 'color', 'priority', or 'new_name' do or their expected formats. This fails to add meaningful semantics beyond the schema.

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 ('Update') and resource ('an existing label in a GitLab project'), making the purpose evident. However, it doesn't differentiate from sibling tools like 'create_label' or 'delete_label' beyond the verb, missing explicit distinction.

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 is provided on when to use this tool versus alternatives like 'create_label' or 'delete_label'. The description implies usage for modifying labels but lacks context about prerequisites, constraints, or specific scenarios.

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/TheRealChrisThomas/gitlab-mcp-server'

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