Skip to main content
Glama
ampcome-mcps

Shortcut MCP Server

by ampcome-mcps

search-iterations

Search for Shortcut project iterations by ID, name, description, state, team, or date ranges to manage workflow cycles.

Instructions

Find Shortcut iterations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoFind only iterations with the specified public ID
nameNoFind only iterations matching the specified name
descriptionNoFind only iterations matching the specified description
stateNoFind only iterations matching the specified state
teamNoFind only iterations matching the specified team. This can be a team ID or mention name.
createdNoThe date in "YYYY-MM-DD" format, or one of the keywords: "yesterday", "today", "tomorrow", or a date range in the format "YYYY-MM-DD..YYYY-MM-DD". The date range can also be open ended by using "*" for one of the bounds. Examples: "2023-01-01", "today", "2023-01-01..*" (from Jan 1, 2023 to any future date), "*.2023-01-31" (any date up to Jan 31, 2023), "today..*" (from today onwards), "*.yesterday" (any date up to yesterday). The keywords cannot be used to calculate relative dates (e.g. the following are not valid: "today-1" or "tomorrow+1").
updatedNoThe date in "YYYY-MM-DD" format, or one of the keywords: "yesterday", "today", "tomorrow", or a date range in the format "YYYY-MM-DD..YYYY-MM-DD". The date range can also be open ended by using "*" for one of the bounds. Examples: "2023-01-01", "today", "2023-01-01..*" (from Jan 1, 2023 to any future date), "*.2023-01-31" (any date up to Jan 31, 2023), "today..*" (from today onwards), "*.yesterday" (any date up to yesterday). The keywords cannot be used to calculate relative dates (e.g. the following are not valid: "today-1" or "tomorrow+1").
startDateNoThe date in "YYYY-MM-DD" format, or one of the keywords: "yesterday", "today", "tomorrow", or a date range in the format "YYYY-MM-DD..YYYY-MM-DD". The date range can also be open ended by using "*" for one of the bounds. Examples: "2023-01-01", "today", "2023-01-01..*" (from Jan 1, 2023 to any future date), "*.2023-01-31" (any date up to Jan 31, 2023), "today..*" (from today onwards), "*.yesterday" (any date up to yesterday). The keywords cannot be used to calculate relative dates (e.g. the following are not valid: "today-1" or "tomorrow+1").
endDateNoThe date in "YYYY-MM-DD" format, or one of the keywords: "yesterday", "today", "tomorrow", or a date range in the format "YYYY-MM-DD..YYYY-MM-DD". The date range can also be open ended by using "*" for one of the bounds. Examples: "2023-01-01", "today", "2023-01-01..*" (from Jan 1, 2023 to any future date), "*.2023-01-31" (any date up to Jan 31, 2023), "today..*" (from today onwards), "*.yesterday" (any date up to yesterday). The keywords cannot be used to calculate relative dates (e.g. the following are not valid: "today-1" or "tomorrow+1").

Implementation Reference

  • The main handler function for the 'search-iterations' tool. Builds a search query, calls the Shortcut client's searchIterations method, handles errors and empty results, and formats the output.
    async searchIterations(params: QueryParams) {
    	const currentUser = await this.client.getCurrentUser();
    	const query = await buildSearchQuery(params, currentUser);
    	const { iterations, total } = await this.client.searchIterations(query);
    
    	if (!iterations)
    		throw new Error(`Failed to search for iterations matching your query: "${query}".`);
    	if (!iterations.length) return this.toResult(`Result: No iterations found.`);
    
    	return this.toResult(
    		`Result (first ${iterations.length} shown of ${total} total iterations found):`,
    		await this.entitiesWithRelatedEntities(iterations, "iterations"),
    	);
    }
  • Registers the 'search-iterations' MCP tool with the server, including description, input schema validation, and links to the handler method.
    server.tool(
    	"search-iterations",
    	"Find Shortcut iterations.",
    	{
    		id: z.number().optional().describe("Find only iterations with the specified public ID"),
    		name: z.string().optional().describe("Find only iterations matching the specified name"),
    		description: z
    			.string()
    			.optional()
    			.describe("Find only iterations matching the specified description"),
    		state: z
    			.enum(["started", "unstarted", "done"])
    			.optional()
    			.describe("Find only iterations matching the specified state"),
    		team: z
    			.string()
    			.optional()
    			.describe(
    				"Find only iterations matching the specified team. This can be a team ID or mention name.",
    			),
    		created: date(),
    		updated: date(),
    		startDate: date(),
    		endDate: date(),
    	},
    	async (params) => await tools.searchIterations(params),
    );
  • Zod-based input schema defining optional parameters for searching iterations: id, name, description, state, team, created, updated, startDate, endDate.
    {
    	id: z.number().optional().describe("Find only iterations with the specified public ID"),
    	name: z.string().optional().describe("Find only iterations matching the specified name"),
    	description: z
    		.string()
    		.optional()
    		.describe("Find only iterations matching the specified description"),
    	state: z
    		.enum(["started", "unstarted", "done"])
    		.optional()
    		.describe("Find only iterations matching the specified state"),
    	team: z
    		.string()
    		.optional()
    		.describe(
    			"Find only iterations matching the specified team. This can be a team ID or mention name.",
    		),
    	created: date(),
    	updated: date(),
    	startDate: date(),
    	endDate: date(),
    },
  • Utility function to build the search query string from input params, handling key mapping, special cases for owner/requester ('me'), booleans, numbers, quoted strings, using supporting getKey and mapKeyName functions.
    export const buildSearchQuery = async (params: QueryParams, currentUser: MemberInfo | null) => {
    	const query = Object.entries(params)
    		.map(([key, value]) => {
    			const q = getKey(key);
    			if (key === "owner" || key === "requester") {
    				if (value === "me") return `${q}:${currentUser?.mention_name || value}`;
    				return `${q}:${String(value || "").replace(/^@/, "")}`;
    			}
    
    			if (typeof value === "boolean") return value ? q : `!${q}`;
    			if (typeof value === "number") return `${q}:${value}`;
    			if (typeof value === "string" && value.includes(" ")) return `${q}:"${value}"`;
    			return `${q}:${value}`;
    		})
    		.join(" ");
    
    	return query;
    };
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 'Find Shortcut iterations' without disclosing behavioral traits. It doesn't mention whether this is a read-only operation, what permissions are needed, how results are returned (pagination, format), rate limits, or error conditions. The description is too minimal for a search tool with 9 parameters.

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 waste. It's appropriately sized for a search tool where parameters are well-documented in the schema, though it could benefit from more context given the lack of annotations.

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 search tool with 9 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'Shortcut iterations' are, how results are structured, whether all parameters are optional, or how to interpret empty results. The schema handles parameter details well, but the description lacks necessary context for effective tool selection.

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 9 parameters thoroughly with descriptions, patterns, and enums. The description adds no parameter semantics beyond the name 'search-iterations', which implies filtering but doesn't explain parameter interactions or default behavior when no parameters are provided.

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

Purpose3/5

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

The description 'Find Shortcut iterations' clearly states the verb ('Find') and resource ('Shortcut iterations'), but it's vague about scope and doesn't differentiate from sibling tools like 'get-active-iterations' or 'get-upcoming-iterations'. It doesn't specify whether this searches all iterations or has specific filtering behavior beyond what parameters imply.

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?

No guidance on when to use this tool versus alternatives like 'get-active-iterations', 'get-upcoming-iterations', or 'get-iteration'. The description doesn't mention prerequisites, context, or exclusions. Usage is implied through parameters but not explicitly stated.

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