stories-remove-external-link
Remove external links from Shortcut stories to maintain clean project documentation and prevent broken references in your workflow.
Instructions
Remove an external link from a Shortcut story
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| storyPublicId | Yes | The public ID of the story | |
| externalLink | Yes | The external link URL to remove |
Implementation Reference
- src/client/shortcut.ts:506-516 (handler)Core handler implementation in ShortcutClientWrapper that fetches the story, removes the matching external link (case-insensitive) from the external_links array, and updates the story via the Shortcut API.async removeExternalLinkFromStory(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 || []; const updatedLinks = currentLinks.filter( (link) => link.toLowerCase() !== externalLink.toLowerCase(), ); return await this.updateStory(storyPublicId, { external_links: updatedLinks }); }
- src/tools/stories.ts:780-789 (handler)Tool-specific handler in StoryTools class that validates inputs and delegates to the ShortcutClientWrapper, then formats the result message.async removeExternalLinkFromStory(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.removeExternalLinkFromStory(storyPublicId, externalLink); return this.toResult( `Removed external link from story sc-${storyPublicId}. Story URL: ${updatedStory.app_url}`, ); }
- src/tools/stories.ts:342-351 (registration)Registration of the 'stories-remove-external-link' tool on the MCP server using addToolWithWriteAccess, linking to the handler method.server.addToolWithWriteAccess( "stories-remove-external-link", "Remove an external link from 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 remove"), }, async ({ storyPublicId, externalLink }) => await tools.removeExternalLinkFromStory(storyPublicId, externalLink), );
- src/tools/stories.ts:345-348 (schema)Zod input schema for the tool parameters: storyPublicId (positive number) and externalLink (URL string max 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 remove"), },