Skip to main content
Glama
useshortcut

Shortcut MCP Server

Official
by useshortcut

stories-get-by-id

Retrieve a specific Shortcut story using its public ID to access project management details and data fields.

Instructions

Get a Shortcut story by public ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
storyPublicIdYesThe public ID of the story to get
fullNoTrue to return all story fields from the API. False to return a slim version that excludes uncommon fields

Implementation Reference

  • Registration of the 'stories-get-by-id' MCP tool, including inline Zod schema and reference to the handler method.
    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),
    );
  • Zod schema defining input parameters for the tool: 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",
    		),
    },
  • Handler function that fetches the story using ShortcutClientWrapper.getStory, handles errors, and formats the output using entityWithRelatedEntities and toResult.
    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),
    	);
    }

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