Skip to main content
Glama
useshortcut

Shortcut MCP Server

Official
by useshortcut

stories-search

Search and filter Shortcut stories by ID, name, type, status, dates, owners, labels, and other attributes to locate specific project management items.

Instructions

Find Shortcut stories.

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 stories with the specified public ID
nameNoFind only stories matching the specified name
descriptionNoFind only stories matching the specified description
commentNoFind only stories matching the specified comment
typeNoFind only stories of the specified type
estimateNoFind only stories matching the specified estimate
branchNoFind only stories matching the specified branch
commitNoFind only stories matching the specified commit
prNoFind only stories matching the specified pull request
projectNoFind only stories matching the specified project
epicNoFind only stories matching the specified epic
objectiveNoFind only stories matching the specified objective
stateNoFind only stories matching the specified state
labelNoFind only stories matching the specified label
ownerNoFind entities where the owner match the specified user. This must either be the user's mention name or the keyword "me" for the current user.
requesterNoFind entities where the requester match the specified user. This must either be the user's mention name or the keyword "me" for the current user.
teamNoFind only stories matching the specified team. This can be a team mention name or team name.
skillSetNoFind only stories matching the specified skill set
productAreaNoFind only stories matching the specified product area
technicalAreaNoFind only stories matching the specified technical area
priorityNoFind only stories matching the specified priority
severityNoFind only stories matching the specified severity
isDoneNoFind only entities that are completed when true, or only entities that are not completed when false.
isStartedNoFind only entities that are started when true, or only entities that are not started when false.
isUnstartedNoFind only entities that are unstarted when true, or only entities that are not unstarted when false.
isUnestimatedNoFind only entities that are unestimated when true, or only entities that are not unestimated when false.
isOverdueNoFind only entities that are overdue when true, or only entities that are not overdue when false.
isArchivedNoFind only entities that are archived when true, or only entities that are not archived when false.
isBlockerNoFind only entities that are blocking when true, or only entities that are not blocking when false.
isBlockedNoFind only entities that are blocked when true, or only entities that are not blocked when false.
hasCommentNoFind only entities that have a comment when true, or only entities that do not have a comment when false. Example: hasOwner: true will find stories with an owner, hasOwner: false will find stories without an owner.
hasLabelNoFind only entities that have a label when true, or only entities that do not have a label when false. Example: hasOwner: true will find stories with an owner, hasOwner: false will find stories without an owner.
hasDeadlineNoFind only entities that have a deadline when true, or only entities that do not have a deadline when false. Example: hasOwner: true will find stories with an owner, hasOwner: false will find stories without an owner.
hasOwnerNoFind only entities that have an owner when true, or only entities that do not have an owner when false. Example: hasOwner: true will find stories with an owner, hasOwner: false will find stories without an owner.
hasPrNoFind only entities that have a pr when true, or only entities that do not have a pr when false. Example: hasOwner: true will find stories with an owner, hasOwner: false will find stories without an owner.
hasCommitNoFind only entities that have a commit when true, or only entities that do not have a commit when false. Example: hasOwner: true will find stories with an owner, hasOwner: false will find stories without an owner.
hasBranchNoFind only entities that have a branch when true, or only entities that do not have a branch when false. Example: hasOwner: true will find stories with an owner, hasOwner: false will find stories without an owner.
hasEpicNoFind only entities that have an epic when true, or only entities that do not have an epic when false. Example: hasOwner: true will find stories with an owner, hasOwner: false will find stories without an owner.
hasTaskNoFind only entities that have a task when true, or only entities that do not have a task when false. Example: hasOwner: true will find stories with an owner, hasOwner: false will find stories without an owner.
hasAttachmentNoFind only entities that have an attachment when true, or only entities that do not have an attachment when false. Example: hasOwner: true will find stories with an owner, hasOwner: false will find stories without an owner.
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").
completedNoThe 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").
dueNoThe 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

  • Registration of the 'stories-search' tool using server.addToolWithReadAccess. Includes the tool name, description, comprehensive input schema using Zod for various search parameters, and references the 'searchStories' handler method.
    server.addToolWithReadAccess(
    	"stories-search",
    	"Find Shortcut stories.",
    	{
    		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 stories with the specified public ID"),
    		name: z.string().optional().describe("Find only stories matching the specified name"),
    		description: z
    			.string()
    			.optional()
    			.describe("Find only stories matching the specified description"),
    		comment: z.string().optional().describe("Find only stories matching the specified comment"),
    		type: z
    			.enum(["feature", "bug", "chore"])
    			.optional()
    			.describe("Find only stories of the specified type"),
    		estimate: z
    			.number()
    			.optional()
    			.describe("Find only stories matching the specified estimate"),
    		branch: z.string().optional().describe("Find only stories matching the specified branch"),
    		commit: z.string().optional().describe("Find only stories matching the specified commit"),
    		pr: z.number().optional().describe("Find only stories matching the specified pull request"),
    		project: z.number().optional().describe("Find only stories matching the specified project"),
    		epic: z.number().optional().describe("Find only stories matching the specified epic"),
    		objective: z
    			.number()
    			.optional()
    			.describe("Find only stories matching the specified objective"),
    		state: z.string().optional().describe("Find only stories matching the specified state"),
    		label: z.string().optional().describe("Find only stories matching the specified label"),
    		owner: user("owner"),
    		requester: user("requester"),
    		team: z
    			.string()
    			.optional()
    			.describe(
    				"Find only stories matching the specified team. This can be a team mention name or team name.",
    			),
    		skillSet: z
    			.string()
    			.optional()
    			.describe("Find only stories matching the specified skill set"),
    		productArea: z
    			.string()
    			.optional()
    			.describe("Find only stories matching the specified product area"),
    		technicalArea: z
    			.string()
    			.optional()
    			.describe("Find only stories matching the specified technical area"),
    		priority: z
    			.string()
    			.optional()
    			.describe("Find only stories matching the specified priority"),
    		severity: z
    			.string()
    			.optional()
    			.describe("Find only stories matching the specified severity"),
    		isDone: is("completed"),
    		isStarted: is("started"),
    		isUnstarted: is("unstarted"),
    		isUnestimated: is("unestimated"),
    		isOverdue: is("overdue"),
    		isArchived: is("archived").default(false),
    		isBlocker: is("blocking"),
    		isBlocked: is("blocked"),
    		hasComment: has("a comment"),
    		hasLabel: has("a label"),
    		hasDeadline: has("a deadline"),
    		hasOwner: has("an owner"),
    		hasPr: has("a pr"),
    		hasCommit: has("a commit"),
    		hasBranch: has("a branch"),
    		hasEpic: has("an epic"),
    		hasTask: has("a task"),
    		hasAttachment: has("an attachment"),
    		created: date(),
    		updated: date(),
    		completed: date(),
    		due: date(),
    	},
    	async ({ nextPageToken, ...params }) => await tools.searchStories(params, nextPageToken),
    );
  • The handler function 'searchStories' that executes the tool logic. Fetches current user, builds search query using 'buildSearchQuery' helper, calls the Shortcut client's 'searchStories' method, handles results and pagination, formats output with 'entitiesWithRelatedEntities'.
    async searchStories(params: QueryParams, nextToken?: string) {
    	const currentUser = await this.client.getCurrentUser();
    	const query = await buildSearchQuery(params, currentUser);
    	const { stories, total, next_page_token } = await this.client.searchStories(query, nextToken);
    
    	if (!stories) throw new Error(`Failed to search for stories matching your query: "${query}".`);
    	if (!stories.length) return this.toResult(`Result: No stories found.`);
    
    	return this.toResult(
    		`Result (${stories.length} shown of ${total} total stories found):`,
    		await this.entitiesWithRelatedEntities(stories, "stories"),
    		next_page_token,
    	);
    }
  • Detailed Zod input schema for 'stories-search' tool, defining optional parameters for filtering stories by ID, name, description, type, state, labels, owners, dates, and various status flags.
    {
    	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 stories with the specified public ID"),
    	name: z.string().optional().describe("Find only stories matching the specified name"),
    	description: z
    		.string()
    		.optional()
    		.describe("Find only stories matching the specified description"),
    	comment: z.string().optional().describe("Find only stories matching the specified comment"),
    	type: z
    		.enum(["feature", "bug", "chore"])
    		.optional()
    		.describe("Find only stories of the specified type"),
    	estimate: z
    		.number()
    		.optional()
    		.describe("Find only stories matching the specified estimate"),
    	branch: z.string().optional().describe("Find only stories matching the specified branch"),
    	commit: z.string().optional().describe("Find only stories matching the specified commit"),
    	pr: z.number().optional().describe("Find only stories matching the specified pull request"),
    	project: z.number().optional().describe("Find only stories matching the specified project"),
    	epic: z.number().optional().describe("Find only stories matching the specified epic"),
    	objective: z
    		.number()
    		.optional()
    		.describe("Find only stories matching the specified objective"),
    	state: z.string().optional().describe("Find only stories matching the specified state"),
    	label: z.string().optional().describe("Find only stories matching the specified label"),
    	owner: user("owner"),
    	requester: user("requester"),
    	team: z
    		.string()
    		.optional()
    		.describe(
    			"Find only stories matching the specified team. This can be a team mention name or team name.",
    		),
    	skillSet: z
    		.string()
    		.optional()
    		.describe("Find only stories matching the specified skill set"),
    	productArea: z
    		.string()
    		.optional()
    		.describe("Find only stories matching the specified product area"),
    	technicalArea: z
    		.string()
    		.optional()
    		.describe("Find only stories matching the specified technical area"),
    	priority: z
    		.string()
    		.optional()
    		.describe("Find only stories matching the specified priority"),
    	severity: z
    		.string()
    		.optional()
    		.describe("Find only stories matching the specified severity"),
    	isDone: is("completed"),
    	isStarted: is("started"),
    	isUnstarted: is("unstarted"),
    	isUnestimated: is("unestimated"),
    	isOverdue: is("overdue"),
    	isArchived: is("archived").default(false),
    	isBlocker: is("blocking"),
    	isBlocked: is("blocked"),
    	hasComment: has("a comment"),
    	hasLabel: has("a label"),
    	hasDeadline: has("a deadline"),
    	hasOwner: has("an owner"),
    	hasPr: has("a pr"),
    	hasCommit: has("a commit"),
    	hasBranch: has("a branch"),
    	hasEpic: has("an epic"),
    	hasTask: has("a task"),
    	hasAttachment: has("an attachment"),
    	created: date(),
    	updated: date(),
    	completed: date(),
    	due: date(),
    },
  • 'buildSearchQuery' utility function called by the handler to construct the Shortcut search query string from input parameters, handling key mapping, special cases for users ('me'), booleans (negation), numbers, and quoted strings.
    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 the full burden of behavioral disclosure. 'Find Shortcut stories' implies a read-only search operation, but it doesn't specify whether this requires authentication, what permissions are needed, whether results are paginated (though 'nextPageToken' in schema hints at this), rate limits, or what the return format looks like. For a complex search tool with 45 parameters, this minimal description leaves critical behavioral aspects undocumented.

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 at just three words, with zero wasted language. It's front-loaded with the core action ('Find Shortcut stories'). While this conciseness comes at the cost of completeness, the description itself is structurally efficient.

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 complex search tool with 45 parameters, no annotations, and no output schema, the description is completely inadequate. It doesn't explain what 'Shortcut stories' are, what fields are returned, how results are structured, whether there are pagination considerations, or any behavioral constraints. The agent would have to rely entirely on the input schema for understanding this tool's functionality.

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?

The schema description coverage is 100%, with each parameter thoroughly documented in the input schema. The description adds no additional parameter information beyond what's already in the schema. According to the rules, when schema coverage is high (>80%), the baseline score is 3 even with no param info in the description, which applies here.

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 stories' is a tautology that essentially restates the tool name 'stories-search'. It provides the basic verb ('Find') and resource ('Shortcut stories') but lacks specificity about what kind of search operation this is (e.g., filtered search with many parameters) and doesn't distinguish it from sibling tools like 'stories-get-by-id' or 'stories-get-by-external-link'.

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 mention that this is for filtered searches across multiple criteria, nor does it differentiate it from simpler lookup tools like 'stories-get-by-id' or other search tools like 'epics-search'. There's no indication of prerequisites, limitations, or typical 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