Skip to main content
Glama
ampcome-mcps

Shortcut MCP Server

by ampcome-mcps

remove-external-link-from-story

Remove external URLs 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
NameRequiredDescriptionDefault
storyPublicIdYesThe public ID of the story
externalLinkYesThe external link URL to remove

Implementation Reference

  • Registers the 'remove-external-link-from-story' tool with MCP server, including description, Zod input schema (storyPublicId: positive number, externalLink: URL string max 2048 chars), and handler lambda delegating to StoryTools method.
    server.tool(
    	"remove-external-link-from-story",
    	"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),
    );
  • StoryTools.removeExternalLinkFromStory: Validates inputs, invokes client method to perform the removal, and returns a user-friendly success message with story URL.
    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}`,
    	);
    }
  • ShortcutClientWrapper.removeExternalLinkFromStory: Fetches the story, filters external_links array to remove the matching link (case-insensitive match), then calls updateStory to persist the change via 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 });
    }

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