Skip to main content
Glama

stories-create-comment

Add comments to Shortcut stories to document progress, provide feedback, or share updates with team members directly from AI development environments.

Instructions

Create a comment on a story

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
storyPublicIdYesThe public ID of the story
textYesThe text of the comment

Implementation Reference

  • The handler function that implements the core logic of the 'stories-create-comment' tool. It validates inputs, fetches the story, creates the comment using the ShortcutClientWrapper, 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}.`, ); }
  • Zod schema defining the input parameters for the tool: storyPublicId (positive number) and text (non-empty string). Used in the tool registration for input validation.
    storyPublicId: z.number().positive().describe("The public ID of the story"), text: z.string().min(1).describe("The text of the comment"), },
  • Registers the 'stories-create-comment' tool on the CustomMcpServer using addToolWithWriteAccess, providing the tool name, description, input schema, and reference to the handler function.
    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/server.ts:47-47 (registration)
    Top-level invocation of StoryTools.create which adds all story-related tools, including 'stories-create-comment', to the MCP server.
    StoryTools.create(client, server);

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/useshortcut/mcp-server-shortcut'

If you have feedback or need assistance with the MCP directory API, please join our Discord server