Skip to main content
Glama

code_check

Read-onlyIdempotent

Checks whether imported modules, referenced names, methods, and arguments exist in Python, Java, Kotlin, and TS/JS code; validates changed lines, snippets, or manifest dependencies against imports.

Instructions

Python, Java, Kotlin, TS/JS imports; other languages: not_checked. For code you wrote or edited: do the modules, names, methods and arguments it uses exist? No arguments: the changes against HEAD. Each site: exists | absent (nearest names) | unknown | not_installed | guarded.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "code_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
depsNoInstead: the manifests' dependencies vs the imports.
diffNoA revision (e.g. 'HEAD'): only lines changed against it.
pathsNoRepository-relative files or directories.
as_pathNoWith snippet: the file it is for.
snippetNoCode not written yet, checked as if it were in as_path.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.4.0
    • changedInput schema / properties / as_path / description
      Previous value: -"With snippet: the repository-relative file it is meant for (imports and relative imports resolve from there)."New value: +"With snippet: the file it is for."
    • addedInput schema / properties / deps
      Added value: +{
      +  "default": false,
      +  "description": "Instead: the manifests' dependencies vs the imports.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / diff / description
      Previous value: -"A revision: check only the sites on lines changed against it, plus new files (e.g. 'HEAD')."New value: +"A revision (e.g. 'HEAD'): only lines changed against it."
    • removedInput schema / properties / env
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "'auto' (default: the project's .venv, venv or env), a virtual environment directory whose base interpreter is a Python installation this system knows, outside the project (nothing the repository supplies is started), or 'none' (standard library only)."
      -}
    • removedInput schema / properties / include_exists
      Removed value: -{
      -  "default": false,
      -  "description": "Also list the sites that exist.",
      -  "type": "boolean"
      -}
    • changedInput schema / properties / paths / description
      Previous value: -"Repository-relative files or directories to check (whole files)."New value: +"Repository-relative files or directories."
    • changedInput schema / properties / snippet / description
      Previous value: -"Python code not written yet, checked as if it were in as_path."New value: +"Code not written yet, checked as if it were in as_path."
  2. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive, and closed-world, so the safety profile is covered. The description adds behavior beyond that: supported languages with an explicit "other languages: not_checked" caveat, and the per-site result vocabulary (exists | absent with nearest names | unknown | not_installed | guarded).

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 the language scope, then the question the tool answers, then the default and result vocabulary – no filler. The telegraphic style ("Each site: exists | absent (nearest names) | ...") is dense but occasionally cryptic rather than maximally readable.

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?

With no output schema, the description carries the return-value burden and does so via the result-status list. It covers language coverage, default scope, and outcome categories; it does not explain how paths/deps modes compose or what a guarded site means in practice.

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?

Schema coverage is 100%, so the baseline is 3. The description earns one more by explaining that an argument-free call defaults to the diff against HEAD, which the schema does not state (diff simply defaults to null), and by clarifying what the enumerated result statuses mean.

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 description states a concrete verification task: does the referenced module, name, method, or argument exist in code the agent wrote or edited, for Python/Java/Kotlin/TS-JS. It is specific about the resource and the check, though it never names a sibling or explains how it differs from analyze or run_tool.

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?

"For code you wrote or edited" gives a clear usage context, and the "No arguments: the changes against HEAD" sentence explains the default invocation path. There are no explicit exclusions or pointers to alternatives among project_query, analyze, or run_tool.

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

Deploy Server

Other Tools