Skip to main content
Glama

Check a diff before it lands

validate_code_change
Read-only

Checks a unified diff for security regressions, dangerous patterns, secrets, and undeclared dependencies before code lands. Returns pass/fail with findings.

Instructions

Validate a code diff for security regressions and issues before it lands.

Takes a unified diff and checks for:

  • Security control regressions (auth, CSRF, TLS, rate limiting removal)

  • New dangerous patterns (eval, exec, SQL injection, etc.)

  • Secrets in added code

  • Hallucinated or undeclared dependencies in added imports and manifest entries (requirements*.txt, pyproject.toml, package.json, go.mod), verified against the package registries. The "registry" field reports "ok", "unreachable" or "error" (lookups incomplete — do not treat pass as clean), or "skipped".

Returns pass/fail with findings.

Requires SKYLOS_API_KEY: this tool returns an authentication error unless the MCP server is started with SKYLOS_API_KEY set. Without a key only analyze works (5 calls/day). The local CLI needs no key: skylos verify <file> and skylos agent install-hooks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
diffYesUnified diff text, e.g. the output of `git diff`.
pathNoProject root the diff applies to; used to find dependency manifests. Relative paths resolve against the MCP server's working directory..
policyNoOptional policy path. Accepted for compatibility but currently not applied to the result.
check_dependenciesNoLook up newly added imports and manifest entries in the package registries (PyPI, npm, Go proxy). False skips these network calls.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv4.49.0
    • addedInput schema / properties / check_dependencies
      Added value: +{
      +  "default": true,
      +  "description": "Look up newly added imports and manifest entries in the package registries (PyPI, npm, Go proxy). False skips these network calls.",
      +  "title": "Check Dependencies",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / diff / description
      Added value: +"Unified diff text, e.g. the output of `git diff`."
    • addedInput schema / properties / path / description
      Added value: +"Project root the diff applies to; used to find dependency manifests. Relative paths resolve against the MCP server's working directory."
    • addedInput schema / properties / policy / description
      Added value: +"Optional policy path. Accepted for compatibility but currently not applied to the result."
  2. Addedv4.10.0

TDQS

A4.4/5.0
Behavior5/5

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

Goes well past the annotations (readOnlyHint=true, openWorldHint=true allow network registry lookups). It discloses the registry field's possible values and warns that 'unreachable'/'error' must not be treated as clean, states the auth requirement and the 5 calls/day unauthenticated limit, and names the keyless CLI path. This is unusually rich behavioral disclosure.

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?

Front-loaded with purpose, then grouped into a scannable check list, return contract, and requirements. Every sentence carries information, though the dependency-registry explanation and auth paragraph make it longer than strictly minimal.

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?

For a 4-parameter validation tool with an output schema, the definition covers everything needed to invoke it correctly: input format (unified diff), the pre-land use case, auth/rate-limit constraints, the degraded-registry caveat, and a keyless alternative. The output schema handles the return shape, so nothing material is missing.

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 `diff`, `path`, `policy`, and `check_dependencies` are already documented in the schema (including the policy caveat and the registry network-call behavior). The description adds the semantics of the output 'registry' field but nothing new about the parameters themselves; baseline 3 applies.

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?

States a specific verb and resource ('Validate a code diff') and immediately scopes it to 'security regressions and issues before it lands.' The enumerated check categories (control regressions, dangerous patterns, secrets, hallucinated dependencies) differentiate it clearly from siblings like quality_check, architecture_check, and secrets_scan.

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?

Provides strong context: pre-land/pre-merge timing, the SKYLOS_API_KEY prerequisite, the fallback when no key is present ('only `analyze` works (5 calls/day)'), and CLI alternatives. It does not explicitly contrast itself with the close siblings verify_change or security_scan, so an agent must still infer which of those to prefer.

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