Skip to main content
Glama

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

NameRequiredDescriptionDefault
fullNoTrue to return all story fields from the API. False to return a slim version that excludes uncommon fields
storyPublicIdYesThe 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

  • 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), );
  • 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), ); }
  • 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", ), },
  • 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; }

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