list-workflows
Retrieve all workflows from Shortcut project management using the MCP server for streamlined integration with AI tools via API token.
Instructions
List all Shortcut workflows
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/workflows.ts:38-42 (registration)Registration of the "workflows-list" MCP tool, which invokes the listWorkflows() handler to list all workflows.server.addToolWithReadAccess( "workflows-list", "List all Shortcut workflows", async () => await tools.listWorkflows(), );
- src/tools/workflows.ts:92-101 (handler)Handler function listWorkflows() that executes the core logic: retrieves all workflows using the Shortcut client and returns formatted result using base helpers.async listWorkflows() { const workflows = await this.client.getWorkflows(); if (!workflows.length) return this.toResult(`No workflows found.`); return this.toResult( `Result (first ${workflows.length} shown of ${workflows.length} total workflows found):`, await this.entitiesWithRelatedEntities(workflows, "workflows"), ); }
- src/tools/base.ts:625-648 (helper)Helper method used by listWorkflows to simplify and enrich workflows with related entities before returning.protected async entitiesWithRelatedEntities( entities: ( | Story | StorySearchResult | StorySlim | Epic | EpicSearchResult | Iteration | IterationSlim | Group | Workflow | ObjectiveSearchResult | Milestone )[], entityType = "entities", ) { const relatedEntities = await Promise.all( entities.map((entity) => this.getRelatedEntities(entity, "list")), ); return { [entityType]: entities.map((entity) => this.getSimplifiedEntity(entity, "list")), relatedEntities: this.mergeRelatedEntities(relatedEntities), }; }
- src/tools/base.ts:650-663 (helper)Helper method used to format the tool response as MCP CallToolResult with text and JSON.protected toResult( message: string, data?: unknown, paginationToken?: string | null | undefined, ): CallToolResult { return { content: [ { type: "text", text: `${message}${data !== undefined ? `\n\n<json>\n${JSON.stringify(data, null, 2)}\n</json>${paginationToken ? `\n\n<next-page-token>${paginationToken}</next-page-token>` : ""}` : ""}`, }, ], }; }
- src/server.ts:52-52 (registration)Invocation of WorkflowTools.create which performs all workflow tool registrations including workflows-list.WorkflowTools.create(client, server);