Skip to main content
Glama

list_workflows

Retrieve and organize workflows with filtering by tags, name, date, success rate, or deletion status, and sorting options for better task management.

Instructions

List all workflows with optional filtering and sorting

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNo
sortNo

Implementation Reference

  • The main handler function for the 'list_workflows' tool. It parses the input arguments using ListWorkflowsSchema, fetches workflows from storage with optional filter and sort, creates summaries, and returns a JSON-formatted response.
    private async listWorkflows(args: unknown) { const parsed = ListWorkflowsSchema.parse(args); const workflows = await this.storage.list(parsed.filter, parsed.sort); // Create summary for each workflow const summaries = workflows.map(w => ({ id: w.id, name: w.name, description: w.description, version: w.version, tags: w.tags, steps_count: w.steps.length, created_at: w.metadata?.created_at, times_run: w.metadata?.times_run || 0, success_rate: w.metadata?.success_rate, is_deleted: w.is_deleted, })); return { content: [ { type: 'text', text: JSON.stringify({ success: true, count: summaries.length, workflows: summaries, }, null, 2), }, ], }; }
  • Zod schema defining the input structure for the 'list_workflows' tool, including optional filter and sort parameters.
    const ListWorkflowsSchema = z.object({ filter: z.object({ tags: z.array(z.string()).optional(), name_contains: z.string().optional(), created_after: z.string().optional(), created_before: z.string().optional(), min_success_rate: z.number().optional(), is_deleted: z.boolean().optional(), }).optional(), sort: z.object({ field: z.enum(['name', 'created_at', 'updated_at', 'times_run', 'success_rate']), order: z.enum(['asc', 'desc']), }).optional(), });
  • src/index.ts:258-261 (registration)
    Tool registration in the getTools() method, defining the name, description, and input schema for 'list_workflows'.
    name: 'list_workflows', description: 'List all workflows with optional filtering and sorting', inputSchema: zodToJsonSchema(ListWorkflowsSchema), },
  • src/index.ts:124-125 (registration)
    Dispatch registration in the CallToolRequestSchema handler switch statement, routing 'list_workflows' calls to the listWorkflows method.
    case 'list_workflows': return await this.listWorkflows(args);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/FiveOhhWon/workflows-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server