Skip to main content
Glama

linear_createIssueRelation

Link Linear issues to show dependencies like blocks, duplicates, or related items using issue IDs and relation types.

Instructions

Create relations between issues (blocks, is blocked by, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueIdYesID or identifier of the first issue (e.g., ABC-123)
relatedIssueIdYesID or identifier of the second issue (e.g., ABC-456)
typeYesType of relation: 'blocks', 'blocked_by', 'related', 'duplicate', 'duplicate_of'

Implementation Reference

  • Handler function for the linear_createIssueRelation tool. Validates input using isCreateIssueRelationArgs type guard and delegates to 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; } }; }
  • Tool definition for linear_createIssueRelation, including input schema (issueId, relatedIssueId, type) and output schema.
    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" } } } } } };
  • Registration of the linear_createIssueRelation handler in the tool handlers map returned by registerToolHandlers.
    linear_createIssueRelation: handleCreateIssueRelation(linearService),
  • Type guard function used in the handler to validate arguments for linear_createIssueRelation.
    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) ); }

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