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
| Name | Required | Description | Default |
|---|---|---|---|
| issueId | Yes | ID or identifier of the issue to add the label to (e.g., ABC-123) | |
| labelId | Yes | ID 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' }, }, }, };
- src/tools/handlers/index.ts:109-109 (registration)Registration of the linear_addIssueLabel tool handler in the registerToolHandlers function.linear_addIssueLabel: handleAddIssueLabel(linearService),
- src/tools/type-guards.ts:226-238 (schema)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' ); }