Skip to main content
Glama
token-context-mcp

token-context-mcp

Repository map

get_repo_map
Read-onlyIdempotent

Generate a token-budgeted, ranked symbol map for a registered repository, helping coding agents retrieve concise structure and navigation context without broad crawling.

Instructions

Ranked symbol map within budget (format='compact' tuples, 'grouped' by file, or 'full' objects; omitted_count tracks cuts). query biases graph rank; use find_symbols for exact names.

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_id": "<repo_id>"
    },
    "name": "get_repo_map"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryNoOptional symbol/topic terms that switch rank_mode from global centrality to seed-biased personalized graph ranking.
formatNoEntry detail: 'compact' returns [id, path:line, kind/name] tuples; 'grouped' maps path to compact lines; 'full' returns full symbol objects, signatures, and evidence.
profileNoNamed budget profile preset ('locate', 'orient', 'impact', 'read'); explicit args override profile defaults (defaults to 'orient').
repo_idYesRegistered repository ID from list_repositories (never a filesystem path; errors with unknown_repo_id if unregistered).
budget_tokensNoToken cap for the response (32 to max_result_tokens); defaults to 'orient' profile (1024) and sets truncated=true if symbols are omitted.
include_testsNoInclude test files and test symbols in ranking when True; defaults to False to prioritize production code.
include_digestsNoInclude per-file 12-char SHA-256 file_digests map in compact or grouped mode (defaults to False).
include_omitted_idsNoInclude up to 10 truncated symbol IDs in omitted_symbol_ids for targeted follow-ups.

Output Schema

NameRequiredDescriptionDefault
dataNoRanked symbol map and omission statistics.
errorNoPresent when the tool call fails (either a structured {code, message, details} object or a diagnostic string).
budgetNoToken budget accounting for this response.
repo_idNoRegistered repository identifier.
evidenceNoSource-verified file line spans and SHA-256 hashes backing the response.
warningsNoFreshness, ambiguity, redaction, or security warnings.
freshnessNoIndex freshness state ('fresh', 'pending', 'stale', or 'unknown').
truncatedNoTrue if items were omitted due to budget or node limits.
ledger_revNoCurrent evidence ledger revision for repo_id.
completenessNoCoverage/resolution completeness indicator.
index_run_idNoIdentifier of the active index snapshot run.
schema_versionNoEnvelope schema version ('1.0').
untrusted_repository_contentNoTrue when payload embeds raw repository text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • changedInput schema / properties / budget_tokens / description
      Previous value: -"Token cap for the response (32 to max_result_tokens); defaults to 'orient' profile (4096) and sets truncated=true if symbols are omitted."New value: +"Token cap for the response (32 to max_result_tokens); defaults to 'orient' profile (1024) and sets truncated=true if symbols are omitted."
    • changedInput schema / properties / format / anyOf
      Previous value: -[
      -  {
      -    "enum": [
      -      "compact",
      -      "full"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "compact",
      +      "grouped",
      +      "full"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / format / description
      Previous value: -"Entry detail: 'compact' returns [id, path:line, kind/name] tuples; 'full' returns full symbol objects, signatures, and evidence."New value: +"Entry detail: 'compact' returns [id, path:line, kind/name] tuples; 'grouped' maps path to compact lines; 'full' returns full symbol objects, signatures, and evidence."
    • addedInput schema / properties / include_digests
      Added value: +{
      +  "default": false,
      +  "description": "Include per-file 12-char SHA-256 file_digests map in compact or grouped mode (defaults to False).",
      +  "title": "Include Digests",
      +  "type": "boolean"
      +}
    • changedOutput schema / properties / data / properties / file_digests / description
      Previous value: -"Map of file path to 12-char SHA-256 prefix in compact mode."New value: +"Map of file path to 12-char SHA-256 prefix (included only when include_digests=True)."
    • addedOutput schema / properties / data / properties / files
      Added value: +{
      +  "additionalProperties": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "description": "Optional path-to-compact-entry map in 'grouped' format.",
      +  "type": "object"
      +}
    • changedOutput schema / properties / data / properties / format / description
      Previous value: -"Effective output format ('compact' or 'full')."New value: +"Effective output format ('compact', 'grouped', or 'full')."
    • changedOutput schema / properties / data / properties / symbols / description
      Previous value: -"Ranked entries: compact tuple [id, path:line, kind/name] or full symbol object."New value: +"Optional ranked entries in 'compact' ([id, path:line, kind/name]) or 'full' (symbol object) format."
  2. Changed8 schema fields changedv0.3.8
    • changedInput schema / properties / budget_tokens / description
      Previous value: -"Maximum token budget for the returned map (32 to max_result_tokens; defaults to profile budget)."New value: +"Token cap for the response (32 to max_result_tokens); defaults to 'orient' profile (4096) and sets truncated=true if symbols are omitted."
    • changedInput schema / properties / format / description
      Previous value: -"Output detail level: 'compact' ([id, path:line, kind/name]) or 'full' (adds signatures and evidence)."New value: +"Entry detail: 'compact' returns [id, path:line, kind/name] tuples; 'full' returns full symbol objects, signatures, and evidence."
    • changedInput schema / properties / include_omitted_ids / description
      Previous value: -"Include IDs of symbols omitted due to token budget truncation."New value: +"Include up to 10 truncated symbol IDs in omitted_symbol_ids for targeted follow-ups."
    • changedInput schema / properties / include_tests / description
      Previous value: -"Include test files and test symbols in the ranked map when True."New value: +"Include test files and test symbols in ranking when True; defaults to False to prioritize production code."
    • changedInput schema / properties / profile / description
      Previous value: -"Named budget profile ('locate', 'orient', 'impact', 'read'); defaults to 'orient'."New value: +"Named budget profile preset ('locate', 'orient', 'impact', 'read'); explicit args override profile defaults (defaults to 'orient')."
    • changedInput schema / properties / query / description
      Previous value: -"Optional focus query or symbol terms to bias personalized graph ranking."New value: +"Optional symbol/topic terms that switch rank_mode from global centrality to seed-biased personalized graph ranking."
    • changedInput schema / properties / repo_id / description
      Previous value: -"Registered repository ID from list_repositories (never a filesystem path)."New value: +"Registered repository ID from list_repositories (never a filesystem path; errors with unknown_repo_id if unregistered)."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "budget": {
      +      "additionalProperties": true,
      +      "description": "Token budget accounting for this response.",
      +      "properties": {
      +        "envelope_reserve": {
      +          "description": "Wire-framing token reserve when budget >= 512.",
      +          "type": "integer"
      +        },
      +        "estimated_tokens": {
      +          "description": "Estimated serialized response tokens.",
      +          "type": "integer"
      +        },
      +        "requested_tokens": {
      +          "description": "Requested or profile-default token budget.",
      +          "type": "integer"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "completeness": {
      +      "additionalProperties": true,
      +      "description": "Coverage/resolution completeness indicator.",
      +      "properties": {
      +        "basis": {
      +          "description": "How completeness was computed.",
      +          "type": "string"
      +        },
      +        "value": {
      +          "description": "Completeness ratio in [0.0, 1.0], or null if N/A.",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "data": {
      +      "additionalProperties": true,
      +      "description": "Ranked symbol map and omission statistics.",
      +      "properties": {
      +        "estimator_version": {
      +          "description": "Token estimator version.",
      +          "type": "string"
      +        },
      +        "file_digests": {
      +          "additionalProperties": {
      +            "type": "string"
      +          },
      +          "description": "Map of file path to 12-char SHA-256 prefix in compact mode.",
      +          "type": "object"
      +        },
      +        "format": {
      +          "description": "Effective output format ('compact' or 'full').",
      +          "type": "string"
      +        },
      +        "omitted_count": {
      +          "description": "Number of ranked symbols omitted due to budget.",
      +          "type": "integer"
      +        },
      +        "omitted_symbol_ids": {
      +          "description": "Up to 10 omitted symbol IDs when include_omitted_ids=True.",
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "prior_evidence": {
      +          "additionalProperties": true,
      +          "description": "Matching verified evidence card from the repo ledger when available.",
      +          "properties": {
      +            "card_id": {
      +              "description": "Ledger card identifier.",
      +              "type": "integer"
      +            },
      +            "recheck_from": {
      +              "description": "Stale anchor paths requiring re-verification when VERIFY_FAILED.",
      +              "items": {
      +                "type": "string"
      +              },
      +              "type": "array"
      +            },
      +            "status": {
      +              "description": "Ledger verification status ('confirmed', 'valid', or 'VERIFY_FAILED').",
      +              "type": "string"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "query": {
      +          "description": "Seed bias query if provided.",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "rank_mode": {
      +          "description": "'seed_biased' when query is provided, otherwise 'global'.",
      +          "type": "string"
      +        },
      +        "symbols": {
      +          "description": "Ranked entries: compact tuple [id, path:line, kind/name] or full symbol object.",
      +          "items": {},
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "error": {
      +      "additionalProperties": true,
      +      "description": "Present when the tool call fails (either a structured {code, message, details} object or a diagnostic string).",
      +      "properties": {
      +        "code": {
      +          "description": "Machine-readable error code.",
      +          "type": "string"
      +        },
      +        "details": {
      +          "description": "Optional structured metadata for the error.",
      +          "type": "object"
      +        },
      +        "message": {
      +          "description": "Human-readable error explanation.",
      +          "type": "string"
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "string"
      +      ]
      +    },
      +    "evidence": {
      +      "description": "Source-verified file line spans and SHA-256 hashes backing the response.",
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "end_line": {
      +            "description": "1-based end line in source.",
      +            "type": "integer"
      +          },
      +          "path": {
      +            "description": "Repository-relative file path.",
      +            "type": "string"
      +          },
      +          "sha256": {
      +            "description": "12-character hex prefix of indexed file SHA-256.",
      +            "type": "string"
      +          },
      +          "start_line": {
      +            "description": "1-based start line in source.",
      +            "type": "integer"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "freshness": {
      +      "description": "Index freshness state ('fresh', 'pending', 'stale', or 'unknown').",
      +      "type": "string"
      +    },
      +    "index_run_id": {
      +      "description": "Identifier of the active index snapshot run.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "ledger_rev": {
      +      "description": "Current evidence ledger revision for repo_id.",
      +      "type": "integer"
      +    },
      +    "repo_id": {
      +      "description": "Registered repository identifier.",
      +      "type": "string"
      +    },
      +    "schema_version": {
      +      "description": "Envelope schema version ('1.0').",
      +      "type": "string"
      +    },
      +    "truncated": {
      +      "description": "True if items were omitted due to budget or node limits.",
      +      "type": "boolean"
      +    },
      +    "untrusted_repository_content": {
      +      "description": "True when payload embeds raw repository text.",
      +      "type": "boolean"
      +    },
      +    "warnings": {
      +      "description": "Freshness, ambiguity, redaction, or security warnings.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  3. Changed7 schema fields changedv0.3.7
    • addedInput schema / properties / budget_tokens / description
      Added value: +"Maximum token budget for the returned map (32 to max_result_tokens; defaults to profile budget)."
    • addedInput schema / properties / format / description
      Added value: +"Output detail level: 'compact' ([id, path:line, kind/name]) or 'full' (adds signatures and evidence)."
    • addedInput schema / properties / include_omitted_ids / description
      Added value: +"Include IDs of symbols omitted due to token budget truncation."
    • addedInput schema / properties / include_tests / description
      Added value: +"Include test files and test symbols in the ranked map when True."
    • addedInput schema / properties / profile / description
      Added value: +"Named budget profile ('locate', 'orient', 'impact', 'read'); defaults to 'orient'."
    • addedInput schema / properties / query / description
      Added value: +"Optional focus query or symbol terms to bias personalized graph ranking."
    • addedInput schema / properties / repo_id / description
      Added value: +"Registered repository ID from list_repositories (never a filesystem path)."
  4. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds genuinely new behavior: the response is budget-capped and truncation is observable via omitted_count. It stops short of describing what a truncated or empty result means beyond that counter.

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?

Two compact sentences with no filler, and the format enumeration plus the budget caveat are front-loaded. The heavy parenthetical packing of format names and omitted_count makes it dense to parse on first read, but nothing is wasted.

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?

An output schema exists, so return values need not be spelled out, and all eight parameters are documented in the schema. The description supplies the budget/truncation framing that ties the tool together, leaving only minor gaps such as when truncation should prompt a narrower profile or query.

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 coverage is 100%, so every parameter already carries its own explanation, including the format modes and the rank-biasing behavior of query. The description restates those meanings in compressed form rather than adding syntax, defaults, or trade-offs the schema lacks; baseline 3 applies.

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 resource and scope: a ranked symbol map constrained by a token budget, with enumerated output formats. It distinguishes itself from find_symbols by noting that exact-name lookups belong there, though the retrieval verb itself is only implied.

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 one explicit routing rule — use find_symbols for exact names — which is the main ambiguity for a symbol-oriented tool. It does not cover other plausible alternatives such as get_file_skeleton or get_impact_slice, so the guidance is clear but not exhaustive.

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