Skip to main content
Glama
useshortcut

Shortcut MCP Server

Official
by useshortcut

iterations-search

Search for Shortcut iterations by ID, name, description, state, team, or date ranges to filter project management data and track development cycles.

Instructions

Find Shortcut iterations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nextPageTokenNoIf a next_page_token was returned from the search result, pass it in to get the next page of results. Should be combined with the original search parameters.
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

  • Registers the 'iterations-search' tool on the MCP server with description, input schema using Zod validators, and points to the searchIterations handler method.
    server.addToolWithReadAccess(
    	"iterations-search",
    	"Find Shortcut iterations.",
    	{
    		nextPageToken: z
    			.string()
    			.optional()
    			.describe(
    				"If a next_page_token was returned from the search result, pass it in to get the next page of results. Should be combined with the original search parameters.",
    			),
    		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 ({ nextPageToken, ...params }) => await tools.searchIterations(params, nextPageToken),
    );
  • Defines the input schema for the 'iterations-search' tool using Zod, including optional parameters for pagination, filtering by id, name, description, state, team, and date fields.
    {
    	nextPageToken: z
    		.string()
    		.optional()
    		.describe(
    			"If a next_page_token was returned from the search result, pass it in to get the next page of results. Should be combined with the original search parameters.",
    		),
    	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(),
    },
  • The core handler function that builds the search query using buildSearchQuery helper and current user context, performs the search via ShortcutClientWrapper.searchIterations, handles errors and empty results, formats the output using toResult and entitiesWithRelatedEntities, and supports pagination with next_page_token.
    async searchIterations(params: QueryParams, nextToken?: string) {
    	const currentUser = await this.client.getCurrentUser();
    	const query = await buildSearchQuery(params, currentUser);
    	const { iterations, total, next_page_token } = await this.client.searchIterations(
    		query,
    		nextToken,
    	);
    
    	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 (${iterations.length} shown of ${total} total iterations found):`,
    		await this.entitiesWithRelatedEntities(iterations, "iterations"),
    		next_page_token,
    	);
    }
  • Helper function to construct the Shortcut search query string from parameter object, handling key mapping, special cases for owner/requester with 'me', boolean negation, quoting phrases, etc.
    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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Find' implies a read-only operation, but the description doesn't specify if this is a safe query, what permissions are needed, whether results are paginated (though 'nextPageToken' in schema hints at it), or the format/scope of returned data. It lacks details on rate limits, authentication requirements, or potential side effects, leaving significant gaps for a search tool.

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 extremely concise with a single sentence 'Find Shortcut iterations.' It's front-loaded and wastes no words, though this brevity contributes to underspecification in other dimensions. Every word earns its place by stating the core action and resource.

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 (10 parameters, no annotations, no output schema, multiple sibling tools), the description is inadequate. It doesn't explain what 'iterations' are, how results are returned, when to use this versus other iteration tools, or behavioral aspects like pagination or error handling. The schema handles parameters well, but the description fails to provide necessary context for effective tool selection and use.

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 detailed descriptions for all 10 parameters including patterns and examples. The description adds no parameter-specific information beyond the schema. According to guidelines, when coverage is high (>80%), the baseline score is 3 even with no param info in the description, as the schema adequately documents parameters.

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

Purpose2/5

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

The description 'Find Shortcut iterations' is a tautology that restates the tool name 'iterations-search' with minimal added value. It specifies the verb 'Find' and resource 'Shortcut iterations', but lacks specificity about what 'iterations' are in this context or how this search differs from other iteration tools like 'iterations-get-active' or 'iterations-get-upcoming'. It doesn't distinguish from siblings beyond the basic action.

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

Usage Guidelines1/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 siblings like 'iterations-get-active', 'iterations-get-upcoming', 'iterations-get-by-id', and 'iterations-create', there's no indication whether this is for general searches, filtered queries, or specific use cases. No exclusions, prerequisites, or comparative context 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