Skip to main content
Glama
magarcia

Linear MCP Server

linear_link_issues

Create relationships between Linear issues to track dependencies, duplicates, and related work items.

Instructions

Create a relationship between issues in Linear

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueIdYesSource issue ID
relatedIssueIdYesTarget issue ID
typeYesRelationship type (e.g., "blocks", "related", "duplicate")

Implementation Reference

  • The main handler function implementing the tool logic: validates inputs (issueId, relatedIssueId, type), checks valid types, verifies mock issues exist and are different, creates mock relation, returns JSON response or error.
    export const linearLinkIssuesHandler = async (
      args: ToolArgs
    ): Promise<{
      content: Array<{ type: string; text: string }>;
      isError?: boolean;
    }> => {
      try {
        // Type check and validate the required inputs
        if (!args.issueId || typeof args.issueId !== 'string') {
          throw new Error('Source issue ID is required and must be a string');
        }
    
        if (!args.relatedIssueId || typeof args.relatedIssueId !== 'string') {
          throw new Error('Target issue ID is required and must be a string');
        }
    
        if (!args.type || typeof args.type !== 'string') {
          throw new Error('Relationship type is required and must be a string');
        }
    
        // Extract and type the arguments properly
        const issueId = args.issueId;
        const relatedIssueId = args.relatedIssueId;
        const type = args.type;
    
        // Validate relationship type
        const validTypes = [
          'blocks',
          'related',
          'duplicate',
          'blocked_by',
          'relates_to',
          'duplicates',
          'is_duplicated_by',
        ];
        if (!validTypes.includes(type.toLowerCase())) {
          throw new Error(`Invalid relationship type. Must be one of: ${validTypes.join(', ')}`);
        }
    
        // Check if issues exist (mock implementation)
        const mockIssues: Record<string, { id: string; title: string; identifier: string }> = {
          issue1: { id: 'issue1', title: 'Test Issue 1', identifier: 'ABC-123' },
          issue2: { id: 'issue2', title: 'Test Issue 2', identifier: 'ABC-124' },
          issue3: { id: 'issue3', title: 'Test Issue 3', identifier: 'ABC-125' },
        };
    
        if (!mockIssues[issueId]) {
          throw new Error(`Source issue with ID ${issueId} not found`);
        }
    
        if (!mockIssues[relatedIssueId]) {
          throw new Error(`Target issue with ID ${relatedIssueId} not found`);
        }
    
        // Check if issues are the same
        if (issueId === relatedIssueId) {
          throw new Error('Cannot create a relationship between an issue and itself');
        }
    
        // For simulation purposes, we'll return a mock response
        const mockRelation: IssueRelationData = {
          id: `relation-${Date.now()}`,
          type: type.toLowerCase(),
          sourceIssueId: issueId,
          targetIssueId: relatedIssueId,
          createdAt: new Date().toISOString(),
        };
    
        // Format the response
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  success: true,
                  relation: mockRelation,
                  sourceIssue: {
                    id: mockIssues[issueId].id,
                    title: mockIssues[issueId].title,
                    identifier: mockIssues[issueId].identifier,
                  },
                  targetIssue: {
                    id: mockIssues[relatedIssueId].id,
                    title: mockIssues[relatedIssueId].title,
                    identifier: mockIssues[relatedIssueId].identifier,
                  },
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error) {
        console.error('Error in linear_link_issues:', error);
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${(error as Error).message || String(error)}`,
            },
          ],
          isError: true,
        };
      }
    };
  • Tool definition including name, description, and input schema specifying required string parameters: issueId, relatedIssueId, type.
    export const linearLinkIssuesTool = {
      name: 'linear_link_issues',
      description: 'Create a relationship between issues in Linear',
      inputSchema: {
        type: 'object' as const,
        properties: {
          issueId: {
            type: 'string',
            description: 'Source issue ID',
          },
          relatedIssueId: {
            type: 'string',
            description: 'Target issue ID',
          },
          type: {
            type: 'string',
            description: 'Relationship type (e.g., "blocks", "related", "duplicate")',
          },
        },
        required: ['issueId', 'relatedIssueId', 'type'],
      },
    };
  • Registers the linear_link_issues tool with its handler using the registerTool function.
    registerTool(linearLinkIssuesTool, linearLinkIssuesHandler);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool creates a relationship, implying a write/mutation operation, but doesn't disclose critical details such as required permissions, whether the relationship is bidirectional, error handling, or any rate limits. This leaves significant gaps for an agent to understand how to use it safely and effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence that efficiently conveys the core purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of creating relationships between issues (a mutation operation) and the absence of both annotations and an output schema, the description is insufficient. It lacks information on behavioral traits, error cases, return values, and how it fits with sibling tools, making it incomplete for safe and effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting all three parameters (issueId, relatedIssueId, type) with their roles and types. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline for high schema coverage without compensating value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a relationship') and resource ('between issues in Linear'), making the purpose understandable. However, it doesn't differentiate this from sibling tools like 'linear_get_issue_relations' or specify what kind of relationship is being created beyond the generic term.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't mention when to use this versus 'linear_get_issue_relations' (which might retrieve existing relationships) or other issue-modification tools, nor does it specify prerequisites like needing issue IDs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/magarcia/mcp-server-linearapp'

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