Skip to main content
Glama

validate_code

Catch hallucinations, missing dependencies, and dead code in AI-generated code snippets or single-file changes with one validation pass.

Instructions

Validate code snippets or single-file changes for hallucinations, missing dependencies, and dead code in one pass. For full-project or monorepo-wide audits, use start_validation on a scoped subdirectory (e.g., frontend/ or backend/).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
newCodeNoThe AI-generated code to validate (optional - omit for dead code scan only)
languageYesProgramming language
sessionIdNoOptional session ID for incremental validation (reuses previous results)
strictModeNoONLY use true if explicitly requested. When true, flags ALL unresolved symbols including edge cases. Default is false which catches likely hallucinations without excessive noise.
projectPathYesPath to the relevant project scope for this snippet/file (e.g., ".", "src", "backend"). For large repository scans, prefer start_validation.
useSmartContextNoUse smart context selection for faster validation (default: true)
recentlyEditedFilesNoOptional list of files edited in this session to boost relevance

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.4.8

TDQS

A4.1/5.0
Behavior3/5

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

No annotations are present, so the description carries the burden. It discloses the validation dimensions and the 'one pass' behavior, but it does not reveal whether the tool is asynchronous, whether results are persisted for later retrieval, or whether any side effects occur. The sibling status/result tools imply a follow-up flow, but the description itself leaves this implicit.

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?

Two sentences, no filler, and the core purpose is front-loaded before the alternative routing. Every clause earns its place.

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 schema covers parameters and the description covers scope, but there is no output schema and no guidance on how results are returned or retrieved (e.g., get_validation_status/get_validation_results). For a 7-parameter validation flow this is a meaningful completeness gap, though sibling names partially compensate.

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 schema already documents all 7 parameters. The description adds no parameter-level detail beyond its general scope statement ('snippets or single-file changes'), so a baseline 3 is appropriate.

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 opens with a specific action and target: 'Validate code snippets or single-file changes for hallucinations, missing dependencies, and dead code in one pass.' It clearly distinguishes from start_validation by scoping to single-file/snippet validation, so an agent can discriminate without inspecting the schema.

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?

It explicitly names the alternative for broader work: 'For full-project or monorepo-wide audits, use start_validation on a scoped subdirectory...' This tells the agent both when to use this tool and when to choose a sibling.

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

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/codegoddy/codeguardian_mcp'

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