Skip to main content
Glama
ampcome-mcps

Shortcut MCP Server

by ampcome-mcps

add-relation-to-story

Link stories in Shortcut by establishing relationships like blocks, duplicates, or relates to connections between work items.

Instructions

Add a story relationship to a story

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
storyPublicIdYesThe public ID of the story
relatedStoryPublicIdYesThe public ID of the related story
relationshipTypeNoThe type of relationshiprelates to

Implementation Reference

  • The handler function that executes the tool logic: validates inputs, fetches stories, adjusts relationship direction if needed (for 'blocked by' or 'duplicated by'), calls the client to add the relation, and returns a success message.
    async addRelationToStory({
    	storyPublicId,
    	relatedStoryPublicId,
    	relationshipType,
    }: {
    	storyPublicId: number;
    	relatedStoryPublicId: number;
    	relationshipType: "relates to" | "blocks" | "blocked by" | "duplicates" | "duplicated by";
    }) {
    	if (!storyPublicId) throw new Error("Story public ID is required");
    	if (!relatedStoryPublicId) throw new Error("Related story public ID is required");
    
    	const story = await this.client.getStory(storyPublicId);
    	if (!story)
    		throw new Error(`Failed to retrieve Shortcut story with public ID: ${storyPublicId}`);
    
    	const relatedStory = await this.client.getStory(relatedStoryPublicId);
    	if (!relatedStory)
    		throw new Error(`Failed to retrieve Shortcut story with public ID: ${relatedStoryPublicId}`);
    
    	let subjectStoryId = storyPublicId;
    	let objectStoryId = relatedStoryPublicId;
    
    	if (relationshipType === "blocked by" || relationshipType === "duplicated by") {
    		relationshipType = relationshipType === "blocked by" ? "blocks" : "duplicates";
    		subjectStoryId = relatedStoryPublicId;
    		objectStoryId = storyPublicId;
    	}
    
    	await this.client.addRelationToStory(subjectStoryId, objectStoryId, relationshipType);
    
    	return this.toResult(
    		relationshipType === "blocks"
    			? `Marked sc-${subjectStoryId} as a blocker to sc-${objectStoryId}.`
    			: relationshipType === "duplicates"
    				? `Marked sc-${subjectStoryId} as a duplicate of sc-${objectStoryId}.`
    				: `Added a relationship between sc-${subjectStoryId} and sc-${objectStoryId}.`,
    	);
    }
  • Zod schema defining the input parameters for the tool: storyPublicId, relatedStoryPublicId, and optional relationshipType.
    	storyPublicId: z.number().positive().describe("The public ID of the story"),
    	relatedStoryPublicId: z.number().positive().describe("The public ID of the related story"),
    	relationshipType: z
    		.enum(["relates to", "blocks", "blocked by", "duplicates", "duplicated by"])
    		.optional()
    		.default("relates to")
    		.describe("The type of relationship"),
    },
  • Registers the MCP tool 'add-relation-to-story' with the server, including description, input schema, and handler reference.
    server.tool(
    	"add-relation-to-story",
    	"Add a story relationship to a story",
    	{
    		storyPublicId: z.number().positive().describe("The public ID of the story"),
    		relatedStoryPublicId: z.number().positive().describe("The public ID of the related story"),
    		relationshipType: z
    			.enum(["relates to", "blocks", "blocked by", "duplicates", "duplicated by"])
    			.optional()
    			.default("relates to")
    			.describe("The type of relationship"),
    	},
    	async (params) => await tools.addRelationToStory(params),
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the action without disclosing behavioral traits. It doesn't mention if this is a mutation (implied by 'Add'), what permissions are needed, whether relationships are bidirectional, or how errors are handled, leaving significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits, usage context, and return values, failing to compensate for the missing structured data, which could lead to incorrect agent usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, providing clear documentation for all parameters. The description adds no additional meaning beyond the schema, such as explaining relationship semantics or constraints, so it meets the baseline but doesn't enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add') and resource ('story relationship to a story'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'update-story' or 'create-story' in terms of relationship-specific functionality, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., existing stories), exclusions, or compare to siblings like 'update-story' for relationship management, leaving the agent with insufficient context for decision-making.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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