List Available Workflows
list_workflowsList all guided workflows that apply Base120 mental models to solve problems.
Instructions
Get all available guided workflows for problem-solving with Base120 mental models.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | ||
| workflows | Yes |
Implementation Reference
- src/tools/workflows.ts:43-67 (handler)The async handler function registered for the 'list_workflows' tool. It calls listWorkflows() from the framework, maps results to a payload with count and workflow details, and returns content with structured JSON.
async () => { const workflows = listWorkflows(); const payload = { count: workflows.length, workflows: workflows.map((wf) => ({ name: wf.name, displayName: wf.displayName, description: wf.description, problemTypes: wf.problemTypes, stepCount: wf.steps.length, estimatedDuration: wf.estimatedDuration, })), }; return { content: [ { type: "text", text: JSON.stringify(payload, null, 2), }, ], structuredContent: payload, } as const; } - src/tools/workflows.ts:22-68 (registration)Registration of the 'list_workflows' tool on the MCP server via server.registerTool(), including input/output schemas, title, and description.
server.registerTool( "list_workflows", { title: "List Available Workflows", description: "Get all available guided workflows for problem-solving with Base120 mental models.", inputSchema: z.object({}), outputSchema: z.object({ count: z.number(), workflows: z.array( z.object({ name: z.string(), displayName: z.string(), description: z.string(), problemTypes: z.array(z.string()), stepCount: z.number(), estimatedDuration: z.string(), }) ), }), }, async () => { const workflows = listWorkflows(); const payload = { count: workflows.length, workflows: workflows.map((wf) => ({ name: wf.name, displayName: wf.displayName, description: wf.description, problemTypes: wf.problemTypes, stepCount: wf.steps.length, estimatedDuration: wf.estimatedDuration, })), }; return { content: [ { type: "text", text: JSON.stringify(payload, null, 2), }, ], structuredContent: payload, } as const; } ); - src/tools/workflows.ts:28-42 (schema)Input/output schemas for list_workflows tool defined using Zod. Input is empty object. Output contains count (number) and workflows array with name, displayName, description, problemTypes, stepCount, estimatedDuration.
inputSchema: z.object({}), outputSchema: z.object({ count: z.number(), workflows: z.array( z.object({ name: z.string(), displayName: z.string(), description: z.string(), problemTypes: z.array(z.string()), stepCount: z.number(), estimatedDuration: z.string(), }) ), }), }, - src/framework/workflows.ts:274-276 (helper)Helper function that returns all workflow templates by extracting values from the WORKFLOW_TEMPLATES record. This is the core data source called by the tool handler.
export function listWorkflows(): WorkflowTemplate[] { return Object.values(WORKFLOW_TEMPLATES); } - src/server.ts:28-29 (registration)The registration call that wires registerWorkflowTools into the MCP server during server creation, which registers the list_workflows tool among others.
registerWorkflowTools(server); // Phase 2: Guided workflows registerExportTools(server);