Skip to main content
Glama

check_code_health

Verify Python source files before tests by detecting syntax errors, undefined symbols, broken local imports, and circular import cycles.

Instructions

Compiler-Grade Preflight & Architecture Health Guard: Sub-15ms static verification that detects syntax errors, undefined/hallucinated symbols, broken local imports, and circular import cycles before running tests.

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": {
      "target_path": "<target_path>"
    },
    "name": "check_code_health"
  }
}

Input Schema

NameRequiredDescriptionDefault
target_pathYesPath to the Python file to verify
project_rootNoProject root directory (default: '.').

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description must carry the whole burden. It does disclose that the check is static and sub-15ms (implying a fast, non-executing read), but it never states that no files are modified, whether it fails or returns diagnostics, or what a caller should expect on a broken file — meaningful gaps for a verification tool.

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?

A single front-loaded sentence that packs the capability and the detected error classes efficiently. Some wording ('Compiler-Grade', 'Architecture Health Guard') is promotional rather than informational, but it does not obscure the meaning.

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?

There is no output schema, and the description doesn't say what the result looks like (pass/fail vs. a diagnostic list), which is the main remaining gap. Given only two parameters and a fully documented schema, though, an agent has enough to call it correctly for a simple preflight check.

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% for both parameters, so the baseline is 3. The mention of broken local imports and circular cycles implicitly explains why project_root matters for module resolution, but no path-format or scope details are added beyond the schema.

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?

States a specific operation (sub-15ms static verification) on a specific resource (a Python file at target_path) and enumerates what it detects: syntax errors, undefined/hallucinated symbols, broken local imports, and circular import cycles. That makes it distinguishable from audit_code_quality or get_architecture_digest, though it never names a sibling explicitly.

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 phrase 'before running tests' implies the intended moment of use, which is real guidance. However, there is no explicit when-not, no prerequisite conditions, and no pointer to alternatives like audit_code_quality when deeper analysis is needed.

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