add-external-link-to-story
Enhance Shortcut stories by inserting external links directly. Input the story's public ID and the desired URL to integrate additional resources seamlessly into project workflows.
Instructions
Add an external link to a Shortcut story
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| externalLink | Yes | The external link URL to add | |
| storyPublicId | Yes | The public ID of the story |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"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
- src/tools/stories.ts:302-310 (registration)Registration of the MCP tool 'stories-add-external-link', including input schema (storyPublicId, externalLink) and handler reference to addExternalLinkToStory method."stories-add-external-link", "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), );
- src/tools/stories.ts:666-675 (handler)The handler function that implements the tool logic: validates inputs, calls client.addExternalLinkToStory, and returns a success message with story URL.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}`, ); }
- src/tools/stories.ts:305-307 (schema)Zod schema for input parameters: storyPublicId (positive number) and externalLink (URL string max 2048 chars). Used in tool registration.storyPublicId: z.number().positive().describe("The public ID of the story"), externalLink: z.string().url().max(2048).describe("The external link URL to add"), },