Skip to main content
Glama

validate_code

Read-only

Validate generated X++/XML code by checking syntax, best-practice rules, and semantic references to ensure correct metadata before writing.

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. 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).
contextNoOptional: owning class/table name, used in diagnostic messages.
codeTypeNo[syntax] "xpp" X++ (default), "xml-table" AxTable, "xml-form" AxForm(+Extension), "xml-report" AxReport, "xml-any" other.xpp

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.16.2
    • changedInput schema / properties / codeType / description
      Previous value: -"[syntax] \"xpp\" for X++ source (default), \"xml-table\" for AxTable XML, \"xml-any\" for other XML."New value: +"[syntax] \"xpp\" X++ (default), \"xml-table\" AxTable, \"xml-form\" AxForm(+Extension), \"xml-report\" AxReport, \"xml-any\" other."
    • changedInput schema / properties / codeType / enum
      Previous value: -[
      -  "xpp",
      -  "xml-table",
      -  "xml-any"
      -]New value: +[
      +  "xpp",
      +  "xml-table",
      +  "xml-form",
      +  "xml-any",
      +  "xml-report"
      +]
    • changedInput schema / properties / mode / description
      Previous value: -"both = run the two checks in ONE call (preferred); syntax = BP/best-practice rules only; references = symbol resolution only."New value: +"both = run the two checks in ONE call (preferred)."
  2. Changed2 schema fields changedv1.14.0
    • changedInput schema / properties / mode / description
      Previous value: -"syntax = BP/best-practice rules; references = symbol resolution against the index. Defaults to syntax."New value: +"both = run the two checks in ONE call (preferred); syntax = BP/best-practice rules only; references = symbol resolution only."
    • changedInput schema / properties / mode / enum
      Previous value: -[
      -  "syntax",
      -  "references"
      -]New value: +[
      +  "both",
      +  "syntax",
      +  "references"
      +]
  3. First observedv1.8.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description adds rich behavioral context: offline operation, no xppbp.exe, index-only reference resolution, structured violation output, and coverage of specific rule families. This makes the tool's side-effect-free and execution model clear.

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 a concise opening line and bullet-separated modes. It front-loads the core purpose, then gives mode-specific detail and final actionable timing guidance. Every sentence contributes useful information without unnecessary repetition.

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?

For a tool with no output schema, the description explains the syntax-mode return shape and the overall verification behavior. It is slightly less explicit about the exact return format for references mode, but the usage context, parameter intent, and integration behavior are otherwise well covered.

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

Parameters4/5

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

The schema already covers all parameters at 100%, so the baseline is 3. The description adds meaningful semantics beyond the schema, especially for mode ('both' preferred), codeType ('xml-table' checks XML refs), and the behavior of references mode. It doesn't enrich the context parameter, but the overall value exceeds baseline.

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 states a specific verb and resource: a static validator for generated X++/XML. The mode breakdown (syntax vs references) and the 'no xppbp.exe' note clearly distinguish it from related siblings like run_bp_check and find_references.

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?

The description gives explicit timing guidance: call mode='both' AFTER generating and BEFORE writes, and fix errors in the same turn. It also notes that write tools run references internally when GROUNDING_ENFORCE=true. It does not explicitly contrast with sibling alternatives, so it stops short of a 5.

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