Skip to main content
Glama
wkoutre

Linear MCP Server

by wkoutre

linear_getComments

Retrieve all comments for a specific Linear issue to track discussions and updates, with configurable limits for efficient review.

Instructions

Get all comments for an issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueIdYesID or identifier of the issue to get comments from (e.g., ABC-123)
limitNoMaximum number of comments to return (default: 25)

Implementation Reference

  • The handler function that implements the core logic for linear_getComments: validates input with isGetCommentsArgs and delegates to LinearService.getComments.
    export function handleGetComments(linearService: LinearService) {
      return async (args: unknown) => {
        try {
          if (!isGetCommentsArgs(args)) {
            throw new Error("Invalid arguments for getComments");
          }
          
          return await linearService.getComments(args.issueId, args.limit);
        } catch (error) {
          logError("Error getting comments for issue", error);
          throw error;
        }
      };
  • The MCPToolDefinition for linear_getComments, specifying input (issueId required, optional limit) and output schemas.
    export const getCommentsToolDefinition: MCPToolDefinition = {
      name: "linear_getComments",
      description: "Get all comments for an issue",
      input_schema: {
        type: "object",
        properties: {
          issueId: {
            type: "string",
            description: "ID or identifier of the issue to get comments from (e.g., ABC-123)",
          },
          limit: {
            type: "number",
            description: "Maximum number of comments to return (default: 25)",
          },
        },
        required: ["issueId"],
      },
      output_schema: {
        type: "array",
        items: {
          type: "object",
          properties: {
            id: { type: "string" },
            body: { type: "string" },
            createdAt: { type: "string" },
            user: { 
              type: "object",
              properties: {
                id: { type: "string" },
                name: { type: "string" }
              }
            },
            url: { type: "string" }
          }
        }
      }
    }; 
  • Registration of the linear_getComments tool in the registerToolHandlers function, mapping it to handleGetComments.
    linear_getComments: handleGetComments(linearService)
  • Type guard isGetCommentsArgs for validating tool input arguments (issueId required, limit optional).
     * Type guard for linear_getComments tool arguments
     */
    export function isGetCommentsArgs(args: unknown): args is {
      issueId: string;
      limit?: number;
    } {
      return (
        typeof args === "object" &&
        args !== null &&
        "issueId" in args &&
        typeof (args as { issueId: string }).issueId === "string" &&
        (!("limit" in args) || typeof (args as { limit: number }).limit === "number")
      );
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior2/5

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

No annotations provided. The description does not disclose behavioral traits such as pagination (limit implies but not stated), ordering, rate limits, or behavior for invalid issueId. For a tool with no annotations, this is insufficient.

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

Conciseness4/5

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

The description is a single clear sentence, front-loaded with purpose. It is concise without being overly terse, though it could include more detail in the same length.

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 has 2 params (both described in schema), no output schema, and no annotations, the description is thin. It does not mention return format, default behavior for missing issueId, or hint at pagination. Completeness is lacking.

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%, so schema already documents issueId and limit well. The description adds no additional meaning beyond the schema. Baseline 3 is appropriate.

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 'Get all comments for an issue' clearly states the verb (Get), resource (comments), and scope (for an issue). It is specific and distinguishes from other get tools like getAttachments, but could be slightly improved by explicitly stating it returns comments for a given issue ID.

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 on when to use this tool vs alternatives. No mention of when not to use it or related tools like createComment, updateComment. The description does not help the agent decide between this and other comment-related tools.

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