list_workflow_rules
Retrieve automation rules for projects or globally to manage workflow configurations and enable rule filtering by project or status.
Instructions
List all automation rules for a project or globally
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | Project ID to filter rules (optional) | |
| enabled_only | No | Only return enabled rules |
Implementation Reference
- src/tools/workflow-automation.ts:140-155 (handler)The core handler function that implements the logic for listing workflow rules: validates input with Zod, fetches rules from Supabase service filtering by project and enabled status, and returns the rules list with total and active counts.export const listWorkflowRules = requireAuth(async (args: any) => { const { project_id, enabled_only } = ListWorkflowRulesSchema.parse(args) logger.info('Listing workflow rules', { project_id, enabled_only }) const rules = await supabaseService.getWorkflowRules({ project_id, enabled: enabled_only ? true : undefined }) return { rules, total_rules: rules.length, active_rules: rules.filter(r => r.enabled).length } })
- Zod schema defining the input parameters for the list_workflow_rules handler: optional project_id and enabled_only boolean.const ListWorkflowRulesSchema = z.object({ project_id: z.string().optional(), enabled_only: z.boolean().default(true) })
- src/tools/workflow-automation.ts:116-133 (registration)MCPTool object that registers the list_workflow_rules tool, including its name, description, and JSON schema for inputs.export const listWorkflowRulesTool: MCPTool = { name: 'list_workflow_rules', description: 'List all automation rules for a project or globally', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID to filter rules (optional)' }, enabled_only: { type: 'boolean', default: true, description: 'Only return enabled rules' } } } }
- src/tools/workflow-automation.ts:602-608 (registration)Object exporting handlers for workflow tools, mapping 'list_workflow_rules' to its handler function for integration into the main tool system.export const workflowAutomationHandlers = { create_workflow_rule: createWorkflowRule, list_workflow_rules: listWorkflowRules, execute_workflow_rule: executeWorkflowRule, create_trigger_automation: createTriggerAutomation, get_automation_analytics: getAutomationAnalytics }
- src/tools/workflow-automation.ts:594-600 (registration)Object exporting MCPTool definitions, including listWorkflowRulesTool for batch registration of workflow automation tools.export const workflowAutomationTools = { createWorkflowRuleTool, listWorkflowRulesTool, executeWorkflowRuleTool, createTriggerAutomationTool, getAutomationAnalyticsTool }