Skip to main content
Glama

validate_code

Validate UdonSharp C# code after writing or editing; on failure, get explanations and fix issues so code passes validation before shipping.

Instructions

WHEN: after writing or editing any UdonSharp script (mandatory). HOW: pass full code. If issues: call explain_validation for each unique ruleId, fix, then re-run validate_code until valid. Never ship code that failed validation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesFull UdonSharp C# to validate AFTER writing/editing. On failure: explain_validation → fix → re-validate.
sdkVersionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries full responsibility for disclosing behavior. It mentions that validation can produce issues with 'unique ruleId' and mandates a re-run loop, but it does not explicitly state whether the tool is read-only, what a successful response looks like, or whether it modifies anything. It offers workflow context but lacks a clear statement of output and side effects.

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 highly concise, using a structured 'WHEN/HOW/If' format that front-loads the critical mandatory usage condition. Every sentence carries functional weight, including the failure-handling workflow and the final policy statement. There is no redundant fluff, making it easy for an agent to parse and act on.

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

Completeness3/5

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

The description covers the main workflow and mandates usage after edits, but it omits explanation of the 'sdkVersion' parameter entirely and does not describe the tool's return format or success criteria beyond 'valid'. Given no output schema and no annotations, this leaves an agent uncertain about what response to expect, especially for optional parameters.

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

Parameters2/5

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

Schema description coverage is 50%, meaning only the 'code' parameter is described in the schema, and that description is detailed ('Full UdonSharp C# to validate AFTER writing/editing...'). However, the tool description itself does not add semantics for the 'sdkVersion' parameter, which is left undocumented in both schema and description. The description merely repeats 'pass full code' without clarifying the optional SDK version parameter or its purpose.

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 tool name 'validate_code' clearly indicates the action of validating code, and the description reinforces this with 'WHEN: after writing or editing any UdonSharp script (mandatory)'. However, it does not explicitly distinguish itself from sibling tools like explain_validation or list_rules, leaving the exact validation scope implied rather than stated.

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?

The description provides explicit usage guidance with 'WHEN: after writing or editing any UdonSharp script (mandatory)', making the trigger condition clear. It also gives a precise workflow: on issues, call explain_validation, fix, and re-run validate_code until valid, and ends with a strong directive 'Never ship code that failed validation.' This fully addresses when and how to use the tool relative to its follow-up sibling.

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