get-workflow
Retrieve a Shortcut workflow using its public ID to access project management details and processes.
Instructions
Get a Shortcut workflow by public ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowPublicId | Yes | The public ID of the workflow to get |
Implementation Reference
- src/tools/workflows.ts:26-35 (handler)The main handler function that fetches the workflow using the ShortcutClientWrapper, handles cases where the workflow is not found, and formats the result using helper methods from BaseTools.async getWorkflow(workflowPublicId: number) { const workflow = await this.client.getWorkflow(workflowPublicId); if (!workflow) return this.toResult(`Workflow with public ID: ${workflowPublicId} not found.`); return this.toResult( `Workflow: ${workflow.id}`, await this.entityWithRelatedEntities(workflow, "workflow"), ); }
- src/tools/workflows.ts:10-15 (registration)Registers the "get-workflow" tool with the MCP server, specifying the name, description, input schema, and handler function.server.tool( "get-workflow", "Get a Shortcut workflow by public ID", { workflowPublicId: z.number().positive().describe("The public ID of the workflow to get") }, async ({ workflowPublicId }) => await tools.getWorkflow(workflowPublicId), );
- src/tools/workflows.ts:13-13 (schema)Zod schema defining the input parameter for the get-workflow tool: a positive number for workflowPublicId.{ workflowPublicId: z.number().positive().describe("The public ID of the workflow to get") },
- src/server.ts:38-38 (registration)Calls WorkflowTools.create to initialize the tools instance and register all workflow-related tools, including get-workflow, with the MCP server.WorkflowTools.create(client, server);