get_workflow
Retrieve a specific workflow by its ID to access structured, multi-step task sequences for execution and analysis.
Instructions
Get a specific workflow by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/index.ts:391-410 (handler)The handler function that executes the 'get_workflow' tool logic. Parses the input arguments using GetWorkflowSchema, retrieves the workflow from storage using the provided ID, handles not-found errors, and returns the workflow as a JSON-formatted text response.private async getWorkflow(args: unknown) { const parsed = GetWorkflowSchema.parse(args); const workflow = await this.storage.get(parsed.id); if (!workflow) { throw new Error(`Workflow not found: ${parsed.id}`); } return { content: [ { type: 'text', text: JSON.stringify({ success: true, workflow, }, null, 2), }, ], }; }
- src/index.ts:51-54 (schema)Zod schema defining the input structure for the 'get_workflow' tool, requiring a single 'id' string parameter.const GetWorkflowSchema = z.object({ id: z.string(), });
- src/index.ts:262-266 (registration)Tool registration in the getTools() method, defining the name, description, and input schema for the 'get_workflow' tool.{ name: 'get_workflow', description: 'Get a specific workflow by ID', inputSchema: zodToJsonSchema(GetWorkflowSchema), },
- src/index.ts:126-127 (registration)Dispatch/registration in the CallToolRequestSchema handler switch statement, routing 'get_workflow' calls to the getWorkflow method.case 'get_workflow': return await this.getWorkflow(args);
- src/services/storage.ts:68-79 (helper)Supporting method in WorkflowStorage that retrieves a workflow by ID from the filesystem, used by the getWorkflow handler.async get(id: string): Promise<Workflow | null> { try { const filePath = this.getWorkflowPath(id); const data = await fs.readFile(filePath, 'utf-8'); return JSON.parse(data) as Workflow; } catch (error) { if ((error as any).code === 'ENOENT') { return null; } throw error; } }