create-story-comment
Add comments to Shortcut stories programmatically by specifying the story ID and comment text, enabling streamlined collaboration and feedback integration.
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)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"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:482-495 (handler)The handler function that implements the logic to create a comment on a Shortcut story using the client API.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:246-254 (registration)Registers the 'stories-create-comment' tool (matching 'create-story-comment' functionality) with the MCP server, linking to the handler.server.addToolWithWriteAccess( "stories-create-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), );
- src/tools/stories.ts:249-252 (schema)Zod schema defining the input parameters for the create-story-comment tool: storyPublicId (number) and text (string).{ storyPublicId: z.number().positive().describe("The public ID of the story"), text: z.string().min(1).describe("The text of the comment"), },