set-story-external-links
Replace all external links on a Shortcut story with a new set of URLs to update reference materials and documentation links.
Instructions
Replace all external links on a story with a new set of links
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| storyPublicId | Yes | The public ID of the story | |
| externalLinks | Yes | Array of external link URLs to set (replaces all existing links) |
Input Schema (JSON Schema)
{
"properties": {
"externalLinks": {
"description": "Array of external link URLs to set (replaces all existing links)",
"items": {
"format": "uri",
"maxLength": 2048,
"type": "string"
},
"type": "array"
},
"storyPublicId": {
"description": "The public ID of the story",
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"storyPublicId",
"externalLinks"
],
"type": "object"
}
Implementation Reference
- src/tools/stories.ts:662-675 (handler)Handler function in StoryTools class that validates parameters, calls the client wrapper to set external links, and formats the 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}`); }
- src/tools/stories.ts:309-320 (registration)Registers the MCP tool 'set-story-external-links' with input schema and thin handler delegating to the StoryTools handler.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), );
- src/client/shortcut.ts:473-475 (helper)ShortcutClientWrapper helper method that sets the story's external_links by calling updateStory with the new array.async setStoryExternalLinks(storyPublicId: number, externalLinks: string[]): Promise<Story> { return await this.updateStory(storyPublicId, { external_links: externalLinks }); }