Skip to main content
Glama

add-external-link-to-story

Add external URLs to Shortcut stories to provide reference materials, documentation links, or related resources directly within project management workflows.

Instructions

Add an external link to a Shortcut story

Input Schema

NameRequiredDescriptionDefault
storyPublicIdYesThe public ID of the story
externalLinkYesThe external link URL to add

Input Schema (JSON Schema)

{ "properties": { "externalLink": { "description": "The external link URL to add", "format": "uri", "maxLength": 2048, "type": "string" }, "storyPublicId": { "description": "The public ID of the story", "exclusiveMinimum": 0, "type": "number" } }, "required": [ "storyPublicId", "externalLink" ], "type": "object" }

Implementation Reference

  • Handler function for the 'add-external-link-to-story' tool. Performs input validation and delegates to the ShortcutClientWrapper to add the link, then returns a formatted result.
    async addExternalLinkToStory(storyPublicId: number, externalLink: string) { if (!storyPublicId) throw new Error("Story public ID is required"); if (!externalLink) throw new Error("External link is required"); const updatedStory = await this.client.addExternalLinkToStory(storyPublicId, externalLink); return this.toResult( `Added external link to story sc-${storyPublicId}. Story URL: ${updatedStory.app_url}`, ); }
  • Core implementation logic for adding an external link to a story. Fetches the current story, checks for duplicate links (case-insensitive), appends the new link if unique, and updates the story via the Shortcut API.
    async addExternalLinkToStory(storyPublicId: number, externalLink: string): Promise<Story> { const story = await this.getStory(storyPublicId); if (!story) throw new Error(`Story ${storyPublicId} not found`); const currentLinks = story.external_links || []; if (currentLinks.some((link) => link.toLowerCase() === externalLink.toLowerCase())) { return story; } const updatedLinks = [...currentLinks, externalLink]; return await this.updateStory(storyPublicId, { external_links: updatedLinks }); }
  • MCP tool registration for 'add-external-link-to-story'. Specifies the tool name, description, input schema using Zod, and the handler function.
    server.tool( "add-external-link-to-story", "Add an external link to a Shortcut story", { storyPublicId: z.number().positive().describe("The public ID of the story"), externalLink: z.string().url().max(2048).describe("The external link URL to add"), }, async ({ storyPublicId, externalLink }) => await tools.addExternalLinkToStory(storyPublicId, externalLink), );
  • Input schema validation using Zod: storyPublicId as positive number, externalLink as valid URL up to 2048 chars.
    storyPublicId: z.number().positive().describe("The public ID of the story"), externalLink: z.string().url().max(2048).describe("The external link URL to add"), },

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/ampcome-mcps/shortcut-mcp'

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