Skip to main content
Glama

analyze_code

Read-only

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

TableJSON Schema
NameRequiredDescriptionDefault
modeYesWhich analysis to run.
limitNo[patterns] Maximum number of pattern examples to return
apiNameNo[api-usage] REQUIRED. Name of the API/class to get usage patterns for.
contextNo[api-usage] Optional context to filter patterns (e.g., "initialization", "validation").
scenarioNo[patterns] REQUIRED. Scenario/functionality to analyze (e.g., "financial dimensions", "inventory transactions").
classNameNo[implementations|completeness] REQUIRED. Class to analyze / containing the method.
methodNameNo[implementations] REQUIRED. Name of the method to implement.
parametersNo[implementations] Method parameters.
returnTypeNo[implementations] Method return type.void
classPatternNo[patterns] Optional class name pattern to filter results (e.g., "Helper", "Service").
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=true, so the tool is known to be harmless. The description adds value by explaining what each mode returns (e.g., 'real implementation examples', 'missing standard methods'), offering behavioral context beyond the schema. It doesn't discuss performance or limitations, but the read-only nature is covered by annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a brief opening and a bulleted list of modes. It is concise enough for a multi-mode tool and front-loads the core action. Every sentence adds information, though the list is somewhat lengthy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Without an output schema, the description compensates by explaining the return type of each mode (patterns, code examples, gaps, usage). Given the tool's complexity (10 params, 4 modes) and the read-only annotation, the description is sufficiently complete for an agent to select and invoke the tool correctly. Minor gaps remain around edge-case behavior, but not critical.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description repeats mode-to-parameter associations (e.g., '[patterns]', '[api-usage]') but does not add substantive meaning beyond what the schema already provides. Each parameter's purpose is already documented in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Learn from the existing codebase' and then enumerates four distinct modes with concrete outcomes (patterns, implementations, completeness, api-usage). It distinguishes itself by naming these modes, though the verb 'learn' is somewhat abstract and it doesn't explicitly contrast with sibling tools like get_method or object_patterns.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides an explicit usage directive: 'call BEFORE generate_object(mode="pattern")' for the patterns mode. Other modes are described with their purposes, implying appropriate use cases, but no exclusions or comparisons to alternative tools are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/dynamics365ninja/d365fo-mcp-server'

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