Skip to main content
Glama

validate_code

Read-only

Validate X++ or XML code for syntax errors, best-practice violations, and missing references. Catch hallucinations before compiling.

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 mode="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.
modeYesboth = run the two checks in ONE call (preferred); syntax = BP/best-practice rules only; references = symbol resolution only.
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 only declare readOnlyHint=true, but the description adds substantial behavior: offline execution, index-only reference resolution, structured violations with specific fields, and catching hallucinated symbols. It even discloses internal behavior of other tools (write tools running references). No contradiction with readOnlyHint.

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

Conciseness5/5

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

The description is well-structured with bullet points for modes, a clear call-to-action sentence for timing, and a note about configuration. Every sentence adds new information; there is no fluff or repetition.

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

Completeness5/5

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

Despite having no output schema, the description covers what each mode returns (structured violations, symbol existence checks), when to call, and even mentions configuration flags. It fully equips an agent to correctly invoke the tool without needing additional context.

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

Parameters5/5

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

Although schema coverage is 100%, the description goes far beyond by explaining the mode enum in detail (what syntax and references each do), how codeType='xml-table' changes reference checking, and the context parameter's purpose. This adds meaningful semantic value to the parameters.

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 the tool validates generated X++/XML, and further distinguishes two modes (syntax and references) with specific purposes. It differentiates from siblings by being offline (no xppbp.exe) and index-only, which is a precise, non-tautological definition.

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 instructs to call mode='both' AFTER generating and BEFORE writes, and recommends fixing errors in the same turn. It also explains when the tool may be redundant (write tools run references internally under GROUNDING_ENFORCE). This provides clear timing and alternative conditions.

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