Skip to main content
Glama

Check a diff before it lands

validate_code_change
Read-only

Validate a unified code diff for security regressions, dangerous patterns, leaked secrets, and undeclared dependencies before it lands.

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, analyze works (5 calls/day) and the local map tools (change_map and the graph_* tools) work with no limit. The local CLI needs no key: skylos verify <file> and skylos agent install-hooks.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "diff": "<diff>"
    },
    "name": "validate_code_change"
  }
}

Input 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

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.1/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses the SKYLOS_API_KEY requirement and that calls fail with an auth error without it, names the rate limit (5/day for analyze), flags that check_dependencies makes network calls to PyPI/npm/Go proxy, and warns that a "registry" status of "unreachable"/"error" means pass should not be treated as clean. That is exactly the operational detail annotations cannot convey.

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 a scannable bullet list, then the credential caveat. Slightly overstuffed at the end: the local CLI instructions (`skylos verify <file>`, `skylos agent install-hooks`) are tangential to invoking this MCP tool and dilute the close.

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?

An output schema exists, so the description needn't explain return shape, and it still usefully explains the registry status semantics. Combined with the auth and network-call disclosures, an agent has what it needs to call this correctly; only explicit sibling routing 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 coverage is 100%, so the schema already documents diff, path, policy and check_dependencies. The description adds meaning to the dependency-manifest scope (requirements*.txt, pyproject.toml, package.json, go.mod) and registry status values, but says nothing extra about diff or path beyond the schema. Baseline 3 for full-coverage schemas 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 with "before it lands," then enumerates the exact classes of issue checked (security regressions, dangerous patterns, secrets, hallucinated dependencies). The diff-scoped framing makes it clearly distinct from repo-wide siblings like security_scan or verify_dead_code.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The "before it lands" phrasing implies pre-commit/pre-merge timing, and the credential paragraph names fallback options (analyze with 5 calls/day, change_map, graph_* tools, local CLI). But there is no explicit statement of when to pick this over sibling tools like verify_change or security_scan, and no when-not-to-use guidance.

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