Skip to main content
Glama

run_static_analysis

Read-onlyIdempotent

Find likely Python bugs such as undefined names and type errors without running tests by scanning repository code with pyflakes and mypy.

Instructions

Run static analyzers (pyflakes, mypy --ignore-missing-imports) over the repo's code.

Use this to find likely bugs without running tests: undefined names, redefinitions, type errors. tools is comma-separated ("pyflakes", "mypy" or both). paths is comma-separated repo-relative paths (default: top-level source dirs). Noise such as unused imports/variables and mypy notes is dropped unless include_style=True. Missing analyzers are pip-installed into the repo env. Returns {issues: [{file, line, code, message, tool}], counts_by_code, commands, commit, truncated}. Static issues are candidates: confirm with a test before reporting.

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": {
      "repo": "<repo>"
    },
    "name": "run_static_analysis"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoYes
pathsNo
toolsNopyflakes,mypy
max_resultsNo
include_styleNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.4/5.0
Behavior4/5

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

Goes well past the annotations by disclosing noise filtering, the default path resolution, the full return shape, and the notable side effect that missing analyzers are pip-installed into the repo env. That install is in mild tension with readOnlyHint=true since it mutates the environment, but it is disclosed rather than concealed, so this is transparency rather than contradiction.

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?

Front-loads the action and the key differentiator, then packs parameter formats, default behavior, side effects, return shape, and a confidence caveat into compact sentences with no filler. Every sentence carries information an agent needs.

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?

Compensates for the missing output schema by describing the return object field-by-field and warns that findings are candidates needing confirmation. Gaps remain on max_results truncation semantics and expected runtime for a potentially expensive whole-repo analysis, but nothing essential to a correct call is absent.

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?

With 0% schema description coverage the description must carry the parameters, and it does for the non-obvious ones: tools as a comma-separated analyzer list with accepted values, paths as comma-separated repo-relative with a documented default, and include_style's effect on noise. Only max_results and repo are left uninterpreted, and both are largely self-evident.

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 ('Run static analyzers (pyflakes, mypy) over the repo's code') and immediately scopes the intent as finding likely bugs without executing tests. That contrast with run_tests lets an agent distinguish the two without opening either schema.

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?

Gives clear selection context ('find likely bugs without running tests') and a downstream discipline rule ('confirm with a test before reporting'), which implicitly routes to run_tests. It stops short of naming the sibling alternative or stating when static analysis is the wrong choice.

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