Skip to main content
Glama

get-stories-by-external-link

Find Shortcut stories containing a specific external URL to track references and dependencies across project management tasks.

Instructions

Find all stories that contain a specific external link

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
externalLinkYesThe external link URL to search for

Implementation Reference

  • Registration of the 'get-stories-by-external-link' tool with MCP server, defining the tool name, description, input schema using Zod, and the handler function.
    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), );
  • Core handler function that performs the tool's logic: validates input, calls the Shortcut client to retrieve stories linked to the external URL, and formats the response 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"), ); }
  • Supporting method in ShortcutClientWrapper that wraps the official Shortcut API call to fetch stories by external link, normalizing the link to lowercase and handling response.
    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 }; }
  • Input schema validation using Zod for the externalLink parameter: must be a valid URL, max 2048 chars.
    externalLink: z.string().url().max(2048).describe("The external link URL to search for"), },

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