Skip to main content
Glama
ampcome-mcps

Shortcut MCP Server

by ampcome-mcps

get-story-branch-name

Generate a valid Git branch name for a Shortcut story to organize development work and track changes.

Instructions

Get a valid branch name for a specific story.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
storyPublicIdYesThe public Id of the story

Implementation Reference

  • The handler function getStoryBranchName that implements the core logic: fetches current user and story, uses existing formatted_vcs_branch_name or generates a new one via createBranchName, and returns the branch name.
    async getStoryBranchName(storyPublicId: number) {
    	const currentUser = await this.client.getCurrentUser();
    	if (!currentUser) throw new Error("Unable to find current user");
    
    	const story = await this.client.getStory(storyPublicId);
    
    	if (!story)
    		throw new Error(`Failed to retrieve Shortcut story with public ID: ${storyPublicId}`);
    
    	const branchName =
    		(story as Story & { formatted_vcs_branch_name: string | null }).formatted_vcs_branch_name ||
    		this.createBranchName(currentUser, story);
    	return this.toResult(`Branch name for story sc-${storyPublicId}: ${branchName}`);
    }
  • Tool registration using server.tool, including name, description, input schema, and reference to the handler method.
    server.tool(
    	"get-story-branch-name",
    	"Get a valid branch name for a specific story.",
    	{
    		storyPublicId: z.number().positive().describe("The public Id of the story"),
    	},
    	async ({ storyPublicId }) => await tools.getStoryBranchName(storyPublicId),
    );
  • Input schema definition using Zod for the storyPublicId parameter.
    {
    	storyPublicId: z.number().positive().describe("The public Id of the story"),
    },
  • Helper function to generate a branch name in the format {mention_name}/sc-{id}/{slugified-name}, truncated to 50 chars.
    private createBranchName(currentUser: MemberInfo, story: Story) {
    	return `${currentUser.mention_name}/sc-${story.id}/${story.name
    		.toLowerCase()
    		.replace(/\s+/g, "-")
    		.replace(/[^\w-]/g, "")}`.substring(0, 50);
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Get' implies a read operation, but doesn't cover aspects like whether it requires authentication, rate limits, error handling, or what format the branch name returns (e.g., string pattern). This leaves 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 that directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized for a simple tool, making it easy to parse quickly.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what a 'valid branch name' entails (e.g., format, constraints) or the return value, which is critical for a tool with implied output complexity. For a read operation with potential behavioral nuances, more context is needed.

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%, with the single parameter 'storyPublicId' well-documented in the schema. The description adds no additional semantic context beyond implying it's for a 'specific story', which the schema already covers. This meets the baseline for high schema coverage without 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 verb 'Get' and the resource 'valid branch name for a specific story', making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get-story' or 'search-stories', which might also retrieve story-related information, leaving some ambiguity about its unique role.

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 specify prerequisites, such as needing a story ID, or compare it to other get/search tools in the sibling list, leaving the agent to infer usage context without explicit direction.

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