Skip to main content
Glama

analyze_repo

Read-onlyIdempotent

Map a public Python GitHub repository by cloning it if needed and returning language stats, packages, entry points, test command, largest modules with imports, README excerpt, and repo notes.

Instructions

Map a public Python GitHub repo. CALL THIS FIRST for any new repo.

Clones the repo if needed (full history, so later blame/bisect work), then returns a RepoMap: lines per language, top-level packages, entry points (console scripts, main.py), test framework and the exact suggested test command, the 25 largest non-test modules with their intra-repo imports (parsed with ast), a README excerpt, and notes such as "no tests found" or "uses C extensions". Results are cached per HEAD commit; pass refresh=True to rebuild.

Args: repo: "owner/name" or a github.com URL. refresh: rebuild even if a map for this commit is cached.

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

Input Schema

NameRequiredDescriptionDefault
repoYes
refreshNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations by disclosing that the repo is cloned locally if needed, that the clone keeps full history so later blame/bisect work is possible, that results are cached per HEAD commit, and that refresh=True forces a rebuild. These are real side effects and cost characteristics an agent would otherwise not know.

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 imperative and the ordering constraint before any detail, then a single sentence covers the clone behavior and the full return shape. The enumeration of RepoMap contents is long but earns its place because there is no output schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, describing the returned RepoMap fields, cache semantics, and refresh behavior is exactly what the description must do, and it does all three. Remaining gaps (private repos, non-Python repos, runtime cost) are minor for a tool this well specified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description carries the full burden, and it does: repo accepts either 'owner/name' or a github.com URL, and refresh is defined as rebuilding despite a cached map for this commit. Both parameters gain meaning that the bare title-only schema does not supply.

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 ('Map a public Python GitHub repo') and immediately scopes it temporally with 'CALL THIS FIRST for any new repo.' The enumeration of what the RepoMap contains makes the tool's output distinguishable from siblings like get_architecture or run_static_analysis.

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?

Explicit when-to-use guidance ('CALL THIS FIRST for any new repo') and a clear conditional for the refresh path. It does not name a when-not case or point to an alternative sibling for a narrower need, which keeps it short of a 5.

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