Skip to main content
Glama
ampcome-mcps

Shortcut MCP Server

by ampcome-mcps

set-story-external-links

Replace all external links on a Shortcut story with new URLs to update references and attachments.

Instructions

Replace all external links on a story with a new set of links

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
storyPublicIdYesThe public ID of the story
externalLinksYesArray of external link URLs to set (replaces all existing links)

Implementation Reference

  • Main handler for the tool: validates parameters, delegates to client wrapper, formats MCP response.
    async setStoryExternalLinks(storyPublicId: number, externalLinks: string[]) {
    	if (!storyPublicId) throw new Error("Story public ID is required");
    	if (!Array.isArray(externalLinks)) throw new Error("External links must be an array");
    
    	const updatedStory = await this.client.setStoryExternalLinks(storyPublicId, externalLinks);
    
    	const linkCount = externalLinks.length;
    	const message =
    		linkCount === 0
    			? `Removed all external links from story sc-${storyPublicId}`
    			: `Set ${linkCount} external link${linkCount === 1 ? "" : "s"} on story sc-${storyPublicId}`;
    
    	return this.toResult(`${message}. Story URL: ${updatedStory.app_url}`);
    }
  • Client wrapper method that implements the external links update by calling the base updateStory API.
    async setStoryExternalLinks(storyPublicId: number, externalLinks: string[]): Promise<Story> {
    	return await this.updateStory(storyPublicId, { external_links: externalLinks });
    }
  • Registers the MCP tool with server, defines input schema using Zod, and wires to handler method.
    server.tool(
    	"set-story-external-links",
    	"Replace all external links on a story with a new set of links",
    	{
    		storyPublicId: z.number().positive().describe("The public ID of the story"),
    		externalLinks: z
    			.array(z.string().url().max(2048))
    			.describe("Array of external link URLs to set (replaces all existing links)"),
    	},
    	async ({ storyPublicId, externalLinks }) =>
    		await tools.setStoryExternalLinks(storyPublicId, externalLinks),
    );
  • Input schema for the tool using Zod validation.
    {
    	storyPublicId: z.number().positive().describe("The public ID of the story"),
    	externalLinks: z
    		.array(z.string().url().max(2048))
    		.describe("Array of external link URLs to set (replaces all existing links)"),
    },

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