create-story-comment
Add comments to Shortcut stories to provide updates, share feedback, or document progress within your project management workflow.
Instructions
Create a comment on a story
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| storyPublicId | Yes | The public ID of the story | |
| text | Yes | The text of the comment |
Input Schema (JSON Schema)
{
"properties": {
"storyPublicId": {
"description": "The public ID of the story",
"exclusiveMinimum": 0,
"type": "number"
},
"text": {
"description": "The text of the comment",
"minLength": 1,
"type": "string"
}
},
"required": [
"storyPublicId",
"text"
],
"type": "object"
}
Implementation Reference
- src/tools/stories.ts:458-471 (handler)The main handler function for the 'create-story-comment' tool. It validates inputs, fetches the story, creates the comment using the Shortcut client, and returns a success message with the comment URL.async createStoryComment({ storyPublicId, text }: { storyPublicId: number; text: string }) { if (!storyPublicId) throw new Error("Story public ID is required"); if (!text) throw new Error("Story comment text is required"); const story = await this.client.getStory(storyPublicId); if (!story) throw new Error(`Failed to retrieve Shortcut story with public ID: ${storyPublicId}`); const storyComment = await this.client.createStoryComment(storyPublicId, { text }); return this.toResult( `Created comment on story sc-${storyPublicId}. Comment URL: ${storyComment.app_url}.`, ); }
- src/tools/stories.ts:227-229 (schema)Zod input schema defining parameters for the 'create-story-comment' tool: storyPublicId (positive number) and text (non-empty string).storyPublicId: z.number().positive().describe("The public ID of the story"), text: z.string().min(1).describe("The text of the comment"), },
- src/tools/stories.ts:223-231 (registration)Registers the 'create-story-comment' tool on the MCP server, providing name, description, input schema, and linking to the createStoryComment handler.server.tool( "create-story-comment", "Create a comment on a story", { storyPublicId: z.number().positive().describe("The public ID of the story"), text: z.string().min(1).describe("The text of the comment"), }, async (params) => await tools.createStoryComment(params), );