Skip to main content
Glama
useshortcut

Shortcut MCP Server

Official
by useshortcut

stories-add-relation

Connect stories in Shortcut by adding relationships like blocks, duplicates, or relates to between them.

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

  • Tool registration for 'stories-add-relation', including input schema and handler reference.
    server.addToolWithWriteAccess(
    	"stories-add-relation",
    	"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),
    );
  • The handler function that fetches stories, adjusts relationship direction if needed, 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 input parameters for the tool.
    	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"),
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Add' implies a mutation operation, the description doesn't disclose important behavioral traits like permission requirements, whether this creates bidirectional relationships, what happens if relationships already exist, error conditions, or side effects. For a mutation tool with zero annotation coverage, this leaves significant gaps.

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 appropriately sized for a tool with good schema documentation and gets straight to the point 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?

For a mutation tool with no annotations and no output schema, the description is inadequate. It doesn't explain what happens after adding the relationship, what the response looks like, error conditions, or important behavioral constraints. Given the complexity of establishing relationships between stories and the lack of structured safety information, the description should provide more context about the operation's effects.

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%, so the schema already documents all three parameters thoroughly with descriptions and enum values. The description adds no additional parameter semantics beyond what's in the schema. With complete schema coverage, the baseline score of 3 is appropriate as the description doesn't need to compensate but also adds no extra value.

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 distinguish this tool from similar sibling tools like 'stories-add-external-link' or 'stories-add-subtask' that also add relationships/connections to stories, leaving some ambiguity about when to choose this specific relationship type.

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. With sibling tools like 'stories-add-external-link' and 'stories-add-subtask' that also add connections to stories, there's no indication of when story-to-story relationships are appropriate versus external links or subtasks. No prerequisites or exclusions are mentioned.

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/useshortcut/mcp-server-shortcut'

If you have feedback or need assistance with the MCP directory API, please join our Discord server