Skip to main content
Glama
useshortcut

Shortcut MCP Server

Official
by useshortcut

iterations-get-active

Retrieve active Shortcut iterations for the current user's teams to track ongoing project timelines and sprints.

Instructions

Get the active Shortcut iterations for the current user based on their team memberships

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
teamIdNoThe ID of a team to filter iterations by

Implementation Reference

  • The handler function that implements the core logic of fetching active iterations either for a specific team or for all teams the current user belongs to, using the ShortcutClientWrapper.
    async getActiveIterations(teamId?: string) {
    	if (teamId) {
    		const team = await this.client.getTeam(teamId);
    		if (!team) throw new Error(`No team found matching id: "${teamId}"`);
    
    		const result = await this.client.getActiveIteration([teamId]);
    		const iterations = result.get(teamId);
    		if (!iterations?.length) return this.toResult(`Result: No active iterations found for team.`);
    		if (iterations.length === 1)
    			return this.toResult(
    				"The active iteration for the team is:",
    				await this.entityWithRelatedEntities(iterations[0], "iteration"),
    			);
    		return this.toResult(
    			"The active iterations for the team are:",
    			await this.entitiesWithRelatedEntities(iterations, "iterations"),
    		);
    	}
    
    	const currentUser = await this.client.getCurrentUser();
    	if (!currentUser) throw new Error("Failed to retrieve current user.");
    
    	const teams = await this.client.getTeams();
    	const teamIds = teams
    		.filter((team) => team.member_ids.includes(currentUser.id))
    		.map((team) => team.id);
    
    	if (!teamIds.length) throw new Error("Current user does not belong to any teams.");
    
    	const resultsByTeam = await this.client.getActiveIteration(teamIds);
    
    	const allActiveIterations = [...resultsByTeam.values()].flat();
    
    	if (!allActiveIterations.length)
    		return this.toResult("Result: No active iterations found for any of your teams.");
    	return this.toResult(
    		`You have ${allActiveIterations.length} active iterations for your teams:`,
    		await this.entitiesWithRelatedEntities(allActiveIterations, "iterations"),
    	);
    }
  • Registers the 'iterations-get-active' tool on the MCP server, including input schema validation with Zod and linking to the getActiveIterations handler.
    server.addToolWithReadAccess(
    	"iterations-get-active",
    	"Get the active Shortcut iterations for the current user based on their team memberships",
    	{
    		teamId: z.string().optional().describe("The ID of a team to filter iterations by"),
    	},
    	async ({ teamId }) => await tools.getActiveIterations(teamId),
    );
  • Zod schema defining the input parameters for the tool: optional teamId string.
    {
    	teamId: z.string().optional().describe("The ID of a team to filter iterations by"),
    },
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. It mentions the tool fetches data based on team memberships but doesn't disclose behavioral traits like whether it requires authentication, returns paginated results, rate limits, error conditions, or what 'active' means operationally. This leaves significant gaps for an agent to understand execution 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 front-loads the core purpose without unnecessary words. Every part ('Get', 'active Shortcut iterations', 'for the current user', 'based on their team memberships') contributes directly to understanding the tool's function.

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

Completeness3/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 minimally complete for a simple read operation. It covers the what and who but lacks details on behavior, return format, or error handling. For a tool with 1 parameter and 100% schema coverage, it's adequate but leaves contextual gaps that could hinder agent reliability.

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 'teamId' documented as 'The ID of a team to filter iterations by'. The description adds no additional parameter semantics beyond this, such as format examples or how filtering interacts with team memberships. Baseline 3 is appropriate given the schema handles parameter documentation adequately.

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 ('Get'), resource ('active Shortcut iterations'), and scope ('for the current user based on their team memberships'). It distinguishes from siblings like 'iterations-get-by-id' (specific iteration) and 'iterations-search' (broader search), but doesn't explicitly contrast with 'iterations-get-upcoming' (similar scope but different status).

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

Usage Guidelines3/5

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

The description implies usage when needing active iterations for the current user's teams, but doesn't specify when to choose this over alternatives like 'iterations-get-upcoming' or 'iterations-search'. No explicit exclusions or prerequisites are mentioned, leaving some ambiguity about optimal use cases.

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