Skip to main content
Glama

linear_createIssueRelation

Establish connections between Linear issues to define dependencies like blocking, duplication, or relationships using relation types such as blocks, blocked_by, related, duplicate, or duplicate_of.

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

  • The MCP tool handler that validates input using type guard and calls LinearService.createIssueRelation to execute the tool logic
    /**
     * Handler for creating an issue relation
     */
    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 service method implementing the core logic: fetches issues, validates relation type, calls Linear SDK's createIssueRelation
     * Creates a relation between two issues
     */
    async createIssueRelation(issueId: string, relatedIssueId: string, relationType: string) {
      try {
        // Get both issues
        const issue = await this.client.issue(issueId);
        if (!issue) {
          throw new Error(`Issue with ID ${issueId} not found`);
        }
    
        const relatedIssue = await this.client.issue(relatedIssueId);
        if (!relatedIssue) {
          throw new Error(`Related issue with ID ${relatedIssueId} not found`);
        }
    
        const validTypes = ["blocks", "duplicate", "related"];
        
        if (!validTypes.includes(relationType)) {
          throw new Error(`${relationType} is not a valid relation type`)
        }
    
        const relation = await this.client.createIssueRelation({
          issueId,
          relatedIssueId,
          // @ts-ignore
          type: relationType, 
        })
    
        // For now, we'll just acknowledge the request with a success message
        // The actual relation creation logic would need to be implemented based on the Linear SDK specifics
        // In a production environment, we should check the SDK documentation for the correct method
    
        return {
          success: true,
          relation,
        };
      } catch (error) {
        console.error('Error creating issue relation:', error);
        throw error;
      }
    }
  • MCPToolDefinition providing input/output schemas, description, and parameters for the tool
    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' },
            },
          },
        },
      },
    };
  • Tool registration in the handlers map returned by registerToolHandlers
    linear_createIssueRelation: handleCreateIssueRelation(linearService),
  • Type guard function used by the handler to validate tool input arguments
     * 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,
        )
      );
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool creates relations but doesn't cover critical aspects like permissions required, whether the operation is reversible, error conditions (e.g., invalid issue IDs), or side effects (e.g., notifications). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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, efficient sentence that front-loads the core action ('Create relations between issues') and includes essential details ('blocks, is blocked by, etc.') without redundancy. Every word serves a purpose, making it appropriately sized and well-structured.

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 tool's complexity as a mutation operation with no annotations and no output schema, the description is incomplete. It lacks information on behavioral traits (e.g., permissions, reversibility), usage guidelines, and output details. For a tool that modifies data, this level of brevity leaves critical gaps for an AI agent to operate effectively.

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?

Schema description coverage is 100%, with clear descriptions for all three parameters, including an enum for 'type'. The description adds minimal value beyond the schema by listing example relation types ('blocks, is blocked by, etc.'), but it doesn't explain parameter interactions or provide additional context like format requirements for IDs. Baseline 3 is appropriate given the schema does the heavy lifting.

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 relations') and resource ('between issues'), specifying the types of relations like 'blocks, is blocked by, etc.' It distinguishes this tool from siblings like linear_createIssue or linear_updateIssue by focusing on issue relationships rather than issue creation or modification. However, it doesn't explicitly differentiate from tools like linear_convertIssueToSubtask that might also involve issue relationships.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., existing issues), exclusions (e.g., when not to create certain relation types), or compare with sibling tools like linear_convertIssueToSubtask for hierarchical relationships. Usage is implied through the action but lacks explicit context.

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/tacticlaunch/mcp-linear'

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