analyze_code
Learn from the existing codebase: discover common patterns, real implementation examples, missing methods, and API usage to guide X++ development in D365 F&O.
Instructions
Learn from the existing codebase. Choose a mode:
• patterns → common classes/methods/dependencies for a scenario (call BEFORE generate_object(mode="pattern")).
• implementations → real implementation examples of a similar method (actual code).
• completeness → missing standard methods on a class (find/exist/validate gaps).
• api-usage → how an API/class is initialized and called in practice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | Which analysis to run. | |
| limit | No | [patterns] Maximum number of pattern examples to return | |
| apiName | No | [api-usage] REQUIRED. Name of the API/class to get usage patterns for. | |
| context | No | [api-usage] Optional context to filter patterns (e.g., "initialization", "validation"). | |
| scenario | No | [patterns] REQUIRED. Scenario/functionality to analyze (e.g., "financial dimensions", "inventory transactions"). | |
| className | No | [implementations|completeness] REQUIRED. Class to analyze / containing the method. | |
| methodName | No | [implementations] REQUIRED. Name of the method to implement. | |
| parameters | No | [implementations] Method parameters. | |
| returnType | No | [implementations] Method return type. | void |
| classPattern | No | [patterns] Optional class name pattern to filter results (e.g., "Helper", "Service"). |