Skip to main content
Glama
Pharaoh - Your AI breaks things it can't see

Pharaoh - Your AI breaks things it can't see

by Pharaoh-so

Codebase Map

get_codebase_map
Read-only

Maps a repo's architecture in one call so AI can orient in unfamiliar code, find modules, and see dependencies, cycles, hot files, endpoints, entry points, clones, and untested high-risk functions.

Instructions

A repo's architecture in one call.

CALL THIS WHEN: • Orienting in a repo or locating a module • The mapped repo name is unknown

RETURNS: Modules and LOC, dependencies and cycles, hot files (5), endpoints (50), entry points (30), exact clones and high-risk functions without direct test links.

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

Input Schema

NameRequiredDescriptionDefault
repoYesRepository name — one of your connected repos.
include_healthNoInclude the Codebase Health baseline
include_metricsNoList the 10 most-changed files instead of 5

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.4
    • addedInput schema / properties / include_health
      Added value: +{
      +  "description": "Include the Codebase Health baseline",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changedv0.1.3
    • changedInput schema / properties / include_metrics / description
      Previous value: -"Include LOC, complexity, change frequency"New value: +"List the 10 most-changed files instead of 5"
  3. Changed4 schema fields changedv0.1.1
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / properties / include_metrics
      Added value: +{
      +  "description": "Include LOC, complexity, change frequency",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / repo
      Added value: +{
      +  "description": "Repository name — one of your connected repos.",
      +  "type": "string"
      +}
    • addedInput schema / required
      Added value: +[
      +  "repo"
      +]
  4. 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 cover the safety profile (readOnly, non-destructive, closed-world), so the description focuses on what the payload contains: modules/LOC, dependencies and cycles, hot files, endpoints, entry points, clones, and untested high-risk functions. The concrete caps (5 hot files, 50 endpoints, 30 entry points) are genuinely useful behavioral detail an agent cannot get from the schema. It does not discuss cost, latency, or behavior when the repo name is invalid.

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?

Three short labeled blocks — headline, when-to-call, returns — with zero filler and the highest-value claim front-loaded. Every sentence carries information.

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 RETURNS section is the right place to spell out the payload and it does so with quantified limits, which is what an agent needs to decide if this call is sufficient versus drilling into get_module_context. Minor gap: no guidance on which of the two boolean options to set for typical orientation use.

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%, so the baseline is 3. The description mentions "hot files (5)" which lightly corroborates the include_metrics semantics (10 most-changed instead of 5), but it adds no explanation of include_health or when to enable either flag.

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?

"A repo's architecture in one call" names a specific resource (repo architecture) and a scope (whole-repo overview), which distinguishes it from narrower siblings like get_module_context and get_blast_radius. It is slightly less crisp about the verb, but the resource and breadth are unmistakable.

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?

The explicit "CALL THIS WHEN" block gives two concrete triggering conditions (orienting in a repo, locating a module) plus a precondition note that the mapped repo name may be unknown. It stops short of naming which sibling to use instead once you already know the module, so it lacks explicit alternatives.

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