get-story
Retrieve Shortcut stories by public ID; optionally fetch all fields or a streamlined version. Integrates Shortcut data access into AI tools via the Shortcut MCP Server API.
Instructions
Get a Shortcut story by public ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| full | No | True to return all story fields from the API. False to return a slim version that excludes uncommon fields | |
| storyPublicId | Yes | The public ID of the story to get |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"full": {
"default": false,
"description": "True to return all story fields from the API. False to return a slim version that excludes uncommon fields",
"type": "boolean"
},
"storyPublicId": {
"description": "The public ID of the story to get",
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"storyPublicId"
],
"type": "object"
}
Implementation Reference
- src/tools/stories.ts:13-27 (registration)Registration of the MCP tool 'stories-get-by-id' (likely 'get-story'), which fetches a Shortcut story by its public ID.server.addToolWithReadAccess( "stories-get-by-id", "Get a Shortcut story by public ID", { storyPublicId: z.number().positive().describe("The public ID of the story to get"), full: z .boolean() .optional() .default(false) .describe( "True to return all story fields from the API. False to return a slim version that excludes uncommon fields", ), }, async ({ storyPublicId, full }) => await tools.getStory(storyPublicId, full), );
- src/tools/stories.ts:470-480 (handler)The main handler function getStory that retrieves the story from the client, formats it with related entities, and returns the result.async getStory(storyPublicId: number, full = false) { const story = await this.client.getStory(storyPublicId); if (!story) throw new Error(`Failed to retrieve Shortcut story with public ID: ${storyPublicId}.`); return this.toResult( `Story: sc-${storyPublicId}`, await this.entityWithRelatedEntities(story, "story", full), ); }
- src/tools/stories.ts:16-25 (schema)Zod schema for the 'stories-get-by-id' tool input parameters: storyPublicId (required number) and full (optional boolean).{ storyPublicId: z.number().positive().describe("The public ID of the story to get"), full: z .boolean() .optional() .default(false) .describe( "True to return all story fields from the API. False to return a slim version that excludes uncommon fields", ), },
- src/client/shortcut.ts:220-227 (helper)Underlying client method that calls the Shortcut API to get a story by public ID.async getStory(storyPublicId: number) { const response = await this.client.getStory(storyPublicId); const story = response?.data ?? null; if (!story) return null; return story; }