Skip to main content
Glama

get-stories-by-external-link

Find all Shortcut stories that contain a specific external URL to track linked content across your project management system.

Instructions

Find all stories that contain a specific external link

Input Schema

NameRequiredDescriptionDefault
externalLinkYesThe external link URL to search for

Input Schema (JSON Schema)

{ "properties": { "externalLink": { "description": "The external link URL to search for", "format": "uri", "maxLength": 2048, "type": "string" } }, "required": [ "externalLink" ], "type": "object" }

Implementation Reference

  • The handler function that executes the tool's core logic: validates input, fetches stories via the Shortcut client, handles empty results, and formats the output using 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"), ); }
  • Registers the MCP tool 'get-stories-by-external-link' with the server, providing the name, description, input schema, and reference to the handler method.
    server.tool( "get-stories-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), );
  • Zod input schema defining 'externalLink' as a URL string with max length 2048 characters.
    { externalLink: z.string().url().max(2048).describe("The external link URL to search for"), },
  • Supporting utility in ShortcutClientWrapper that calls the base Shortcut API's getExternalLinkStories method with lowercased external_link, handling response and returning stories with total count.
    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 }; }

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