Skip to main content
Glama

linear_addIssueLabel

Add a label to an issue in Linear to organize and categorize project tasks for better tracking and management.

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 main handler function that implements the linear_addIssueLabel tool. It validates input using isAddIssueLabelArgs and calls linearService.addIssueLabel to add the label to the 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 for the linear_addIssueLabel tool, including input and output schemas.
    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' },
        },
      },
    };
  • Registration of the linear_addIssueLabel tool handler in the registerToolHandlers function.
    linear_addIssueLabel: handleAddIssueLabel(linearService),
  • Type guard function for validating input arguments to the linear_addIssueLabel tool.
    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'
      );
    }

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/tacticlaunch/mcp-linear'

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