linear_createComment
Add comments to Linear issues to provide updates, share information, or ask questions, using Markdown formatting for clarity.
Instructions
Add a comment to an issue in Linear
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueId | Yes | ID or identifier of the issue to comment on (e.g., ABC-123) | |
| body | Yes | Text of the comment (Markdown supported) |
Implementation Reference
- The handler function that implements the core logic for the linear_createComment tool. It validates the input arguments using the isCreateCommentArgs type guard and calls the LinearService to create the comment.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; } }; }
- Defines the tool schema for linear_createComment, specifying input (issueId, body) and output structure.export const createCommentToolDefinition: MCPToolDefinition = { name: "linear_createComment", description: "Add a comment to an issue in Linear", 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)", }, }, required: ["issueId", "body"], }, output_schema: { type: "object", properties: { id: { type: "string" }, body: { type: "string" }, url: { type: "string" } } } };
- src/tools/handlers/index.ts:83-83 (registration)Registers the linear_createComment tool in the handlers map by associating it with the handleCreateComment function curried with linearService.linear_createComment: handleCreateComment(linearService),
- src/tools/type-guards.ts:180-194 (schema)Type guard function used by the handler to validate input arguments for the linear_createComment tool.* Type guard for linear_createComment tool arguments */ export function isCreateCommentArgs(args: unknown): args is { issueId: string; body: 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" ); }