get_automation_rule
Retrieve details of a specific automation rule to manage GitHub project workflows, enabling users to view rule configurations and settings for automated task management.
Instructions
Get details of a specific automation rule
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ruleId | Yes |
Implementation Reference
- Primary handler implementation in ProjectManagementService that retrieves a specific automation rule by ID from the automation repository, formats the response, and handles errors.async getAutomationRule(data: { ruleId: string }): Promise<{ id: string; name: string; description?: string; projectId: string; enabled: boolean; triggers: any[]; actions: any[]; createdAt: string; updatedAt?: string; }> { try { const rule = await this.automationRepo.findById(data.ruleId); if (!rule) { throw new ResourceNotFoundError(ResourceType.RELATIONSHIP, data.ruleId); } return { id: rule.id, name: rule.name, description: rule.description, projectId: rule.projectId, enabled: rule.enabled, triggers: rule.triggers, actions: rule.actions, createdAt: rule.createdAt.toISOString(), updatedAt: rule.updatedAt?.toISOString() }; } catch (error) { throw this.mapErrorToMCPError(error); } }
- Tool definition including schema (zod validation), description, and usage examples for get_automation_rule. Schema requires 'ruleId' string.export const getAutomationRuleTool: ToolDefinition<GetAutomationRuleArgs> = { name: "get_automation_rule", description: "Get details of a specific automation rule", schema: getAutomationRuleSchema as unknown as ToolSchema<GetAutomationRuleArgs>, examples: [ { name: "Get rule details", description: "Retrieve details of an automation rule", args: { ruleId: "AR_kwDOLhQ7gc4AOEbH" } } ] };
- src/infrastructure/tools/ToolRegistry.ts:282-282 (registration)Registration of the getAutomationRuleTool in the central ToolRegistry singleton.this.registerTool(getAutomationRuleTool);
- src/index.ts:475-476 (handler)MCP server dispatcher that routes 'get_automation_rule' tool calls to the ProjectManagementService handler.case "get_automation_rule": return await this.service.getAutomationRule(args);
- Getter for the AutomationRuleRepository used by the handler to persist/retrieve rules.return this.factory.createAutomationRuleRepository(); }