Skip to main content
Glama

pg_diagnose

Runs static syntax, type, and lint diagnostics on Python or TypeScript targets, including custom commands, to surface code issues before verification.

Instructions

Run static syntax/type/lint diagnostics (Python AST, ruff, pyright, tsc, or custom diag_cmd).

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": "pg_diagnose"
  }
}

Input Schema

NameRequiredDescriptionDefault
slotNoWorkspace slot name (optional if only one slot is open or `--slot` default is set).
sub_idNoOptional sub-worktree ID.
targetsNoOptional relative file paths to check.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.1

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, and it does not say whether files are modified, whether the run is expensive/long, how the engine is chosen (auto-detect vs config-declared diag_cmd), or what the outcome looks like on success versus failure. The mention of a 'custom diag_cmd' hints at configuration, but nothing tells the agent what happens by default or what permissions/timeouts apply.

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?

A single front-loaded sentence with the action and the supported engines, no filler or redundancy. Every element earns its place by naming the concrete toolchains the agent can expect.

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?

For a three-optional-parameter diagnostics runner with no output schema and no annotations, the description should at minimum indicate what is returned (structured findings vs pass/fail) and how the engine is selected. It covers the what but leaves the agent guessing about results and defaults.

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% (slot, sub_id, targets all documented), so the baseline is 3. The description adds only indirect meaning — that 'targets' are what the linters consume — and says nothing about how slot/sub_id interact with which workspace gets diagnosed.

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 verb ('Run') and resource ('static syntax/type/lint diagnostics') and even enumerates the concrete engines (Python AST, ruff, pyright, tsc, custom diag_cmd), so the agent knows exactly what class of operation this is. It does not, however, distinguish itself from adjacent siblings such as pg_verify, pg_test_target, or pg_test_impact, leaving the agent to infer that this is static analysis rather than test execution.

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?

Usage is only implied: the word 'static' signals this is pre-runtime checking rather than running tests, which weakly separates it from pg_test_impact/pg_test_target. There is no explicit when-to-use, when-not-to-use, or prerequisite statement (e.g. whether a slot must be open, whether diag_cmd requires configuration first).

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