Skip to main content
Glama

validate_code

Read-only

Validates generated X++/XML code for syntax and best-practice violations, and verifies that all referenced types, fields, and methods exist to prevent compilation errors before writing changes.

Instructions

Static validator for generated X++/XML (paste the text). Choose a mode: • syntax → offline best-practice/BP validator (no xppbp.exe). Structured violations {rule, severity, line, excerpt, fix}. Covers select, CoC, BP and table-XML rules mined from standard models. • references → semantic reference resolver (index-only): verifies every type, field, method (incl. arity), enum, label and intrinsic (tableStr/fieldStr/…) EXISTS in the indexed codebase — catches hallucinated symbols before the compiler. codeType="xml-table" checks XML refs instead: EDT/enum/relation/extends/label. Call both AFTER generating, BEFORE writes; fix errors in the same turn. Write tools run references internally when GROUNDING_ENFORCE=true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesX++ source code or XML metadata to validate. Paste the full generated text.
modeYessyntax = BP/best-practice rules; references = symbol resolution against the index. Defaults to syntax.
contextNoOptional: owning class/table name, used in diagnostic messages.
codeTypeNo[syntax] "xpp" for X++ source (default), "xml-table" for AxTable XML, "xml-any" for other XML.xpp
Behavior5/5

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

Annotations provide readOnlyHint=true, and the description adds crucial behavioral details: it is offline (no xppbp.exe for syntax mode), returns structured violations with specific fields, and catches hallucinated symbols in reference mode. It also discloses the 'index-only' limitation and XML-specific behavior—valuable context not available from annotations alone.

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 dense but well-structured with bullets and bolded mode names. Every sentence adds value, though it is slightly longer than necessary (e.g., the parenthetical 'no xppbp.exe' could be integrated more compactly). Overall, it is front-loaded and readable.

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 adequately explains the return format for syntax mode ('Structured violations {rule, severity, line, excerpt, fix}') but is thinner on reference mode's return structure. Still, given the tool's complexity and the rich schema/annotations, it covers the essential triggers, prerequisites, and limitations well.

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 adds a little extra color (e.g., 'Paste the full generated text') but does not significantly extend beyond the schema's parameter descriptions. It correctly mentions the mode options but reuses the same terminology.

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

Purpose5/5

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

The description clearly states it is a 'Static validator for generated X++/XML' and specifies two modes ('syntax' and 'references') with distinct purposes. It distinguishes itself from siblings like 'run_bp_check' and 'find_references' by explicitly framing it as a pre-write validation tool.

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

Usage Guidelines5/5

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

Explicitly states when to use it: 'Call both AFTER generating, BEFORE writes; fix errors in the same turn.' Also explains that write tools run references internally when GROUNDING_ENFORCE=true, giving context on when manual reference checking is needed. This goes beyond vague context to actionable usage guidance.

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