iterations-get-stories
Retrieve stories from a specific Shortcut iteration using its public ID. Optionally include story descriptions for detailed task information.
Instructions
Get stories in a specific iteration by iteration public ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| iterationPublicId | Yes | The public ID of the iteration | |
| includeStoryDescriptions | No | Indicate whether story descriptions should be included. Including descriptions may take longer and will increase the size of the response. |
Implementation Reference
- src/tools/iterations.ts:114-129 (handler)The handler function that implements the core logic of the 'iterations-get-stories' tool by fetching stories from the Shortcut client for the given iteration and formatting the result.async getIterationStories(iterationPublicId: number, includeDescription: boolean) { const { stories } = await this.client.listIterationStories( iterationPublicId, includeDescription, ); if (!stories) throw new Error( `Failed to retrieve Shortcut stories in iteration with public ID: ${iterationPublicId}.`, ); return this.toResult( `Result (${stories.length} stories found):`, await this.entitiesWithRelatedEntities(stories, "stories"), ); }
- src/tools/iterations.ts:13-28 (registration)Registers the 'iterations-get-stories' tool on the MCP server, including the input schema definition and reference to the handler function.server.addToolWithReadAccess( "iterations-get-stories", "Get stories in a specific iteration by iteration public ID", { iterationPublicId: z.number().positive().describe("The public ID of the iteration"), includeStoryDescriptions: z .boolean() .optional() .default(false) .describe( "Indicate whether story descriptions should be included. Including descriptions may take longer and will increase the size of the response.", ), }, async ({ iterationPublicId, includeStoryDescriptions }) => await tools.getIterationStories(iterationPublicId, includeStoryDescriptions), );
- src/tools/iterations.ts:16-25 (schema)Zod schema defining the input parameters for the 'iterations-get-stories' tool: iterationPublicId (required positive number) and includeStoryDescriptions (optional boolean, default false).{ iterationPublicId: z.number().positive().describe("The public ID of the iteration"), includeStoryDescriptions: z .boolean() .optional() .default(false) .describe( "Indicate whether story descriptions should be included. Including descriptions may take longer and will increase the size of the response.", ), },