Skip to main content
Glama

linear_createComment

Add comments to Linear issues by specifying the issue ID and comment text. Supports Markdown formatting for clear, structured communication in project management tasks.

Instructions

Add a comment to an issue in Linear

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesText of the comment (Markdown supported)
issueIdYesID or identifier of the issue to comment on (e.g., ABC-123)

Implementation Reference

  • The main handler function for the linear_createComment tool. It validates the input arguments using the isCreateCommentArgs type guard and delegates to linearService.createComment(args) to perform the actual API call.
    export function handleCreateComment(linearService: LinearService) { return async (args: unknown) => { try { if (!isCreateCommentArgs(args)) { throw new Error('Invalid arguments for createComment'); } return await linearService.createComment(args); } catch (error) { logError('Error creating comment', error); throw error; } }; }
  • The MCPToolDefinition object defining the input schema (issueId, body, optional parentId), output schema, name, and description for the linear_createComment tool.
    export const createCommentToolDefinition: MCPToolDefinition = { name: 'linear_createComment', description: 'Add a comment to an issue in Linear (supports threaded replies)', input_schema: { type: 'object', properties: { issueId: { type: 'string', description: 'ID or identifier of the issue to comment on (e.g., ABC-123)', }, body: { type: 'string', description: 'Text of the comment (Markdown supported)', }, parentId: { type: 'string', description: 'ID of the parent comment to reply to (for threaded comments)', }, }, required: ['issueId', 'body'], }, output_schema: { type: 'object', properties: { id: { type: 'string' }, body: { type: 'string' }, url: { type: 'string' }, parentId: { type: 'string' }, }, }, };
  • Registration of the linear_createComment tool handler in the main tool handlers registry, mapping the tool name to the handleCreateComment function curried with the LinearService instance.
    linear_createComment: handleCreateComment(linearService),
  • Type guard function used by the handler to validate and narrow the type of input arguments for the linear_createComment tool.
    export function isCreateCommentArgs(args: unknown): args is { issueId: string; body: string; parentId?: string; } { return ( typeof args === 'object' && args !== null && 'issueId' in args && typeof (args as { issueId: string }).issueId === 'string' && 'body' in args && typeof (args as { body: string }).body === 'string' && (!('parentId' in args) || typeof (args as { parentId: string }).parentId === 'string') ); }

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