list_workflow_rules
List automation rules for a project or across the entire workspace. Filter by project ID or enabled status to view specific rules.
Instructions
List all automation rules for a project or globally
Input 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 main handler function for the 'list_workflow_rules' tool. Calls supabaseService.getWorkflowRules() with optional project_id and enabled_only filters, then returns the rules along with 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 } }) - Input validation schema (Zod) for list_workflow_rules. Defines optional project_id string and enabled_only boolean (default true).
const ListWorkflowRulesSchema = z.object({ project_id: z.string().optional(), enabled_only: z.boolean().default(true) }) - src/tools/workflow-automation.ts:116-133 (registration)Tool registration object (MCPTool) for 'list_workflow_rules'. Defines name, description, and inputSchema for the MCP tool listing.
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)Export of all workflow automation handlers, mapping 'list_workflow_rules' to the listWorkflowRules handler function.
export const workflowAutomationHandlers = { create_workflow_rule: createWorkflowRule, list_workflow_rules: listWorkflowRules, execute_workflow_rule: executeWorkflowRule, create_trigger_automation: createTriggerAutomation, get_automation_analytics: getAutomationAnalytics } - src/lib/api-client.ts:635-638 (helper)Backend API helper getWorkflowRules() called by the handler. Currently a placeholder returning empty array (not yet implemented in API).
async getWorkflowRules(filter: any): Promise<any[]> { logger.warn('Workflow rules not yet implemented in API') return [] }