linear_createIssueRelation
Define issue relationships in Linear, such as blocking, dependency, or duplication, by linking two specified issues with a chosen relation type.
Instructions
Create relations between issues (blocks, is blocked by, etc.)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueId | Yes | ID or identifier of the first issue (e.g., ABC-123) | |
| relatedIssueId | Yes | ID or identifier of the second issue (e.g., ABC-456) | |
| type | Yes | Type of relation: 'blocks', 'blocked_by', 'related', 'duplicate', 'duplicate_of' |
Implementation Reference
- The main handler function for the linear_createIssueRelation tool. It validates input using type guard and calls linearService.createIssueRelation.export function handleCreateIssueRelation(linearService: LinearService) { return async (args: unknown) => { try { if (!isCreateIssueRelationArgs(args)) { throw new Error('Invalid arguments for createIssueRelation'); } return await linearService.createIssueRelation(args.issueId, args.relatedIssueId, args.type); } catch (error) { logError('Error creating issue relation', error); throw error; } }; }
- The schema definition for the linear_createIssueRelation tool, including input and output schemas.export const createIssueRelationToolDefinition: MCPToolDefinition = { name: 'linear_createIssueRelation', description: 'Create relations between issues (blocks, is blocked by, etc.)', input_schema: { type: 'object', properties: { issueId: { type: 'string', description: 'ID or identifier of the first issue (e.g., ABC-123)', }, relatedIssueId: { type: 'string', description: 'ID or identifier of the second issue (e.g., ABC-456)', }, type: { type: 'string', description: "Type of relation: 'blocks', 'blocked_by', 'related', 'duplicate', 'duplicate_of'", enum: ['blocks', 'blocked_by', 'related', 'duplicate', 'duplicate_of'], }, }, required: ['issueId', 'relatedIssueId', 'type'], }, output_schema: { type: 'object', properties: { success: { type: 'boolean' }, relation: { type: 'object', properties: { id: { type: 'string' }, type: { type: 'string' }, issueIdentifier: { type: 'string' }, relatedIssueIdentifier: { type: 'string' }, }, }, }, }, };
- src/tools/handlers/index.ts:116-116 (registration)Registration of the tool handler in the registerToolHandlers function.linear_createIssueRelation: handleCreateIssueRelation(linearService),
- src/tools/type-guards.ts:306-326 (helper)Type guard function used to validate arguments for the linear_createIssueRelation tool.* Type guard for linear_createIssueRelation tool arguments */ export function isCreateIssueRelationArgs(args: unknown): args is { issueId: string; relatedIssueId: string; type: 'blocks' | 'blocked_by' | 'related' | 'duplicate' | 'duplicate_of'; } { return ( typeof args === 'object' && args !== null && 'issueId' in args && typeof (args as { issueId: string }).issueId === 'string' && 'relatedIssueId' in args && typeof (args as { relatedIssueId: string }).relatedIssueId === 'string' && 'type' in args && typeof (args as { type: string }).type === 'string' && ['blocks', 'blocked_by', 'related', 'duplicate', 'duplicate_of'].includes( (args as { type: string }).type, ) ); }