get-stories-by-external-link
Search and retrieve all stories in Shortcut that include a specific external link, enabling efficient tracking of linked references in your project management workflow.
Instructions
Find all stories that contain a specific external link
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| externalLink | Yes | The external link URL to search for |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"externalLink": {
"description": "The external link URL to search for",
"format": "uri",
"maxLength": 2048,
"type": "string"
}
},
"required": [
"externalLink"
],
"type": "object"
}
Implementation Reference
- src/tools/stories.ts:336-343 (registration)Registration of the tool 'stories-get-by-external-link' (note: code uses 'stories-' prefix) with input schema and reference to handler method.server.addToolWithReadAccess( "stories-get-by-external-link", "Find all stories that contain a specific external link", { externalLink: z.string().url().max(2048).describe("The external link URL to search for"), }, async ({ externalLink }) => await tools.getStoriesByExternalLink(externalLink), );
- src/tools/stories.ts:339-341 (schema)Zod input schema for the tool: externalLink as a URL string up to 2048 chars.{ externalLink: z.string().url().max(2048).describe("The external link URL to search for"), },
- src/tools/stories.ts:688-701 (handler)Tool handler: getStoriesByExternalLink calls client method and formats output with toResult and entitiesWithRelatedEntities.async getStoriesByExternalLink(externalLink: string) { if (!externalLink) throw new Error("External link is required"); const { stories, total } = await this.client.getStoriesByExternalLink(externalLink); if (!stories || !stories.length) { return this.toResult(`No stories found with external link: ${externalLink}`); } return this.toResult( `Found ${total} stories with external link: ${externalLink}`, await this.entitiesWithRelatedEntities(stories, "stories"), ); }
- src/client/shortcut.ts:518-527 (handler)Core API wrapper handler in ShortcutClientWrapper: calls base ShortcutClient.getExternalLinkStories with lowercased link.async getStoriesByExternalLink(externalLink: string) { const response = await this.client.getExternalLinkStories({ external_link: externalLink.toLowerCase(), }); const stories = response?.data; if (!stories) return { stories: null, total: null }; return { stories, total: stories.length }; }