Skip to main content
Glama
kunwarVivek

mcp-github-project-manager

create_label

Create a new label in GitHub projects to categorize issues and pull requests by specifying name, color, and optional description.

Instructions

Create a new GitHub label

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
colorYes
descriptionNo

Implementation Reference

  • Core handler function that executes the create_label tool by calling GitHub GraphQL API to create a repository label with name, color, and optional description.
    async createLabel(data: {
      name: string;
      color: string;
      description?: string;
    }): Promise<{ id: string; name: string; color: string; description: string }> {
      try {
        const mutation = `
          mutation($input: CreateLabelInput!) {
            createLabel(input: $input) {
              label {
                id
                name
                color
                description
              }
            }
          }
        `;
    
        interface CreateLabelResponse {
          createLabel: {
            label: {
              id: string;
              name: string;
              color: string;
              description: string;
            }
          }
        }
    
        const response = await this.factory.graphql<CreateLabelResponse>(mutation, {
          input: {
            repositoryId: this.factory.getConfig().repo,
            name: data.name,
            color: data.color,
            description: data.description || ''
          }
        });
    
        return response.createLabel.label;
      } catch (error) {
        throw this.mapErrorToMCPError(error);
      }
    }
  • Zod schema defining input validation for create_label tool: name (required string), color (6-digit hex), description (optional).
    export const createLabelSchema = z.object({
      name: z.string().min(1, "Label name is required"),
      color: z.string().regex(/^[0-9a-fA-F]{6}$/, "Color must be a valid 6-digit hex color code without #"),
      description: z.string().optional(),
    });
    
    export type CreateLabelArgs = z.infer<typeof createLabelSchema>;
  • MCP tool dispatching switch case that routes create_label calls to ProjectManagementService.createLabel(args).
    case "create_label":
      return await this.service.createLabel(args);
  • ToolRegistry registers createLabelTool (imported from ToolSchemas.ts) making it available for MCP list_tools and call_tool.
    this.registerTool(createLabelTool);
  • ToolDefinition for create_label including name, description, input schema reference, and usage example.
    export const createLabelTool: ToolDefinition<CreateLabelArgs> = {
      name: "create_label",
      description: "Create a new GitHub label",
      schema: createLabelSchema as unknown as ToolSchema<CreateLabelArgs>,
      examples: [
        {
          name: "Create bug label",
          description: "Create a red bug label",
          args: {
            name: "bug",
            color: "ff0000",
            description: "Something isn't working"
          }
        }
      ]
    };
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. 'Create' implies a write operation, but it doesn't specify required permissions, rate limits, error conditions, or what happens on success (e.g., returns the created label). For a mutation tool, this lack of detail 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 no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. This is an example of optimal conciseness for a simple tool.

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 (a write operation with 3 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions or outcomes, and the parameters are undocumented. For a creation tool in a GitHub context, more context is needed to be fully helpful.

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 schema description coverage is 0%, so the schema provides no parameter descriptions. The tool description doesn't mention any parameters, leaving all three (name, color, description) undocumented. However, since there are only 3 parameters and the tool name implies basic creation, a baseline score of 3 is appropriate, though the description adds no value 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 'Create a new GitHub label' clearly states the verb ('Create') and resource ('GitHub label'), making the purpose immediately understandable. However, it doesn't differentiate this from sibling tools like 'create_issue' or 'create_milestone' beyond specifying the resource type, which is why it doesn't reach a perfect score.

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. It doesn't mention prerequisites (e.g., repository permissions), when it's appropriate (e.g., for organizing issues), or what other tools might be related (like 'list_labels' for viewing existing ones). This leaves the agent with minimal 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/kunwarVivek/mcp-github-project-manager'

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