Skip to main content
Glama
wkoutre

Linear MCP Server

by wkoutre

linear_addIssueLabel

Add a label to a Linear issue using its ID and label ID to organize and categorize project tasks.

Instructions

Add a label to an issue in Linear

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueIdYesID or identifier of the issue to add the label to (e.g., ABC-123)
labelIdYesID of the label to add to the issue

Implementation Reference

  • The handler function that implements the core logic of the linear_addIssueLabel tool. It validates the input arguments using the type guard and delegates to the LinearService to add the label to the issue.
    /**
     * Handler for adding a label to an issue
     */
    export function handleAddIssueLabel(linearService: LinearService) {
      return async (args: unknown) => {
        try {
          if (!isAddIssueLabelArgs(args)) {
            throw new Error("Invalid arguments for addIssueLabel");
          }
          
          return await linearService.addIssueLabel(args.issueId, args.labelId);
        } catch (error) {
          logError("Error adding label to issue", error);
          throw error;
        }
      };
    }
  • The schema definition (MCPToolDefinition) for the linear_addIssueLabel tool, specifying input parameters (issueId, labelId) and output structure.
    /**
     * Tool definition for adding a label to an issue
     */
    export const addIssueLabelToolDefinition: MCPToolDefinition = {
      name: "linear_addIssueLabel",
      description: "Add a label to an issue in Linear",
      input_schema: {
        type: "object",
        properties: {
          issueId: {
            type: "string",
            description: "ID or identifier of the issue to add the label to (e.g., ABC-123)",
          },
          labelId: {
            type: "string",
            description: "ID of the label to add to the issue",
          },
        },
        required: ["issueId", "labelId"],
      },
      output_schema: {
        type: "object",
        properties: {
          success: { type: "boolean" },
          issueId: { type: "string" },
          labelId: { type: "string" }
        }
      }
    };
  • The registration of the linear_addIssueLabel handler within the registerToolHandlers function, which maps tool names to their handler functions for the MCP server.
    export function registerToolHandlers(linearService: LinearService) {
      return {
        // User tools
        linear_getViewer: handleGetViewer(linearService),
        linear_getOrganization: handleGetOrganization(linearService),
        linear_getUsers: handleGetUsers(linearService),
        linear_getLabels: handleGetLabels(linearService),
    
        // Team tools
        linear_getTeams: handleGetTeams(linearService),
        linear_getWorkflowStates: handleGetWorkflowStates(linearService),
    
        // Project tools
        linear_getProjects: handleGetProjects(linearService),
        linear_createProject: handleCreateProject(linearService),
        
        // Project Management tools
        linear_updateProject: handleUpdateProject(linearService),
        linear_addIssueToProject: handleAddIssueToProject(linearService),
        linear_getProjectIssues: handleGetProjectIssues(linearService),
        
        // Cycle Management tools
        linear_getCycles: handleGetCycles(linearService),
        linear_getActiveCycle: handleGetActiveCycle(linearService),
        linear_addIssueToCycle: handleAddIssueToCycle(linearService),
    
        // Issue tools
        linear_getIssues: handleGetIssues(linearService),
        linear_getIssueById: handleGetIssueById(linearService),
        linear_searchIssues: handleSearchIssues(linearService),
        linear_createIssue: handleCreateIssue(linearService),
        linear_updateIssue: handleUpdateIssue(linearService),
        linear_createComment: handleCreateComment(linearService),
        linear_addIssueLabel: handleAddIssueLabel(linearService),
        linear_removeIssueLabel: handleRemoveIssueLabel(linearService),
        
        // New Issue Management tools
        linear_assignIssue: handleAssignIssue(linearService),
        linear_subscribeToIssue: handleSubscribeToIssue(linearService),
        linear_convertIssueToSubtask: handleConvertIssueToSubtask(linearService),
        linear_createIssueRelation: handleCreateIssueRelation(linearService),
        linear_archiveIssue: handleArchiveIssue(linearService),
        linear_setIssuePriority: handleSetIssuePriority(linearService),
        linear_transferIssue: handleTransferIssue(linearService),
        linear_duplicateIssue: handleDuplicateIssue(linearService),
        linear_getIssueHistory: handleGetIssueHistory(linearService),
        
        // Comment Management tools
        linear_getComments: handleGetComments(linearService)
      };
    }
  • Type guard function used in the handler to validate the input arguments for the linear_addIssueLabel tool.
     * Type guard for linear_addIssueLabel tool arguments
     */
    export function isAddIssueLabelArgs(args: unknown): args is {
      issueId: string;
      labelId: string;
    } {
      return (
        typeof args === "object" &&
        args !== null &&
        "issueId" in args &&
        typeof (args as { issueId: string }).issueId === "string" &&
        "labelId" in args &&
        typeof (args as { labelId: string }).labelId === "string"
      );
    }
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 the action ('Add a label') but doesn't cover critical aspects like required permissions, whether this is a mutation (implied but not explicit), error handling, or rate limits. This is inadequate for a tool that modifies data.

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 that directly states the tool's purpose without any fluff. It's front-loaded and wastes no words, making it easy for an agent to parse quickly.

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 tool's complexity (a mutation with 2 parameters) and lack of annotations and output schema, the description is incomplete. It doesn't explain behavioral traits, error cases, or return values, leaving significant gaps for an agent to operate safely and effectively.

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 100%, with clear descriptions for both parameters (issueId and labelId). The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints, so it meets the baseline score for high schema coverage.

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 ('Add a label') and target resource ('to an issue in Linear'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'linear_removeIssueLabel' or 'linear_updateIssue', which could handle similar operations, so it doesn't reach the highest 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., needing an existing issue and label), exclusions, or comparisons to siblings like 'linear_updateIssue' for bulk operations, leaving the agent to infer usage 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/wkoutre/linear-mcp-server'

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