get-workflow
Retrieve workflow details from Shortcut project management using the workflow's public ID to access specific project information and processes.
Instructions
Get a Shortcut workflow by public ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowPublicId | Yes | The public ID of the workflow to get |
Input Schema (JSON Schema)
{
"properties": {
"workflowPublicId": {
"description": "The public ID of the workflow to get",
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"workflowPublicId"
],
"type": "object"
}
Implementation Reference
- src/tools/workflows.ts:26-35 (handler)The main handler function that executes the 'get-workflow' tool logic: fetches the workflow by public ID from the client, handles not found case, and formats the result with related entities using helper methods.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-14 (registration)Registers the 'get-workflow' tool with the MCP server, specifying description, input schema (Zod validator for workflowPublicId), and delegates execution to the getWorkflow handler.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)Input schema for the 'get-workflow' tool using Zod: requires a positive number for workflowPublicId.{ workflowPublicId: z.number().positive().describe("The public ID of the workflow to get") },