linear_addIssueToProject
Add an existing issue to a Linear project to organize and track work within project structures. Specify the issue ID and project ID to establish the connection.
Instructions
Add an existing issue to a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueId | Yes | ID or identifier of the issue to add to the project | |
| projectId | Yes | ID of the project to add the issue to |
Implementation Reference
- The main handler function that implements the tool logic for linear_addIssueToProject. It validates the input arguments using a type guard and calls the LinearService method to add the issue to the project.export function handleAddIssueToProject(linearService: LinearService) { return async (args: unknown) => { try { if (!isAddIssueToProjectArgs(args)) { throw new Error('Invalid arguments for addIssueToProject'); } return await linearService.addIssueToProject(args.issueId, args.projectId); } catch (error) { logError('Error adding issue to project', error); throw error; } }; }
- The MCPToolDefinition containing the input schema (issueId and projectId required) and output schema for the linear_addIssueToProject tool.export const addIssueToProjectToolDefinition: MCPToolDefinition = { name: 'linear_addIssueToProject', description: 'Add an existing issue to a project', input_schema: { type: 'object', properties: { issueId: { type: 'string', description: 'ID or identifier of the issue to add to the project', }, projectId: { type: 'string', description: 'ID of the project to add the issue to', }, }, required: ['issueId', 'projectId'], }, output_schema: { type: 'object', properties: { success: { type: 'boolean' }, issue: { type: 'object', properties: { id: { type: 'string' }, identifier: { type: 'string' }, title: { type: 'string' }, project: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, }, }, }, }, }, }, };
- src/tools/handlers/index.ts:82-82 (registration)Registration of the tool name 'linear_addIssueToProject' mapped to its handler function in the central tool handlers registry.linear_addIssueToProject: handleAddIssueToProject(linearService),
- src/tools/type-guards.ts:446-461 (helper)Type guard function used in the handler to validate that input arguments contain required string fields: issueId and projectId./** * Type guard for linear_addIssueToProject tool arguments */ export function isAddIssueToProjectArgs(args: unknown): args is { issueId: string; projectId: string; } { return ( typeof args === 'object' && args !== null && 'issueId' in args && typeof (args as { issueId: string }).issueId === 'string' && 'projectId' in args && typeof (args as { projectId: string }).projectId === 'string' ); }