workflows-get-by-id
Retrieve a specific workflow from Shortcut project management using its public ID. Returns either full workflow details or a slim version based on your needs.
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 | |
| full | No | True to return all workflow fields from the API. False to return a slim version that excludes uncommon fields |
Implementation Reference
- src/tools/workflows.ts:81-90 (handler)Handler function that fetches the workflow by public ID using the Shortcut client, handles not found case, and formats the response with related entities.async getWorkflow(workflowPublicId: number, full = false) { 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", full), ); }
- src/tools/workflows.ts:22-36 (registration)Registers the 'workflows-get-by-id' tool on the CustomMcpServer with input schema and lambda handler delegating to getWorkflow method.server.addToolWithReadAccess( "workflows-get-by-id", "Get a Shortcut workflow by public ID", { workflowPublicId: z.number().positive().describe("The public ID of the workflow to get"), full: z .boolean() .optional() .default(false) .describe( "True to return all workflow fields from the API. False to return a slim version that excludes uncommon fields", ), }, async ({ workflowPublicId, full }) => await tools.getWorkflow(workflowPublicId, full), );
- src/tools/workflows.ts:25-34 (schema)Zod input schema defining parameters: workflowPublicId (required positive number) and full (optional boolean, default false).{ workflowPublicId: z.number().positive().describe("The public ID of the workflow to get"), full: z .boolean() .optional() .default(false) .describe( "True to return all workflow fields from the API. False to return a slim version that excludes uncommon fields", ), },
- src/tools/workflows.ts:88-89 (helper)Calls helper method to enrich the workflow entity with related entities, used in the response formatting.await this.entityWithRelatedEntities(workflow, "workflow", full), );