Skip to main content
Glama

Investigate Codebase

investigate_codebase
Read-onlyIdempotent

Inspect source structure, symbols, references, callers, callees, and impact by mode to locate definitions and trace dependencies in a local repository.

Instructions

Điều tra kho mã nguồn Tier 2: 'outline' (chữ ký class/hàm/docstring), 'symbol' (định nghĩa và references bằng Jedi), 'grep' (văn bản/regex), 'ast' (mẫu cú pháp), 'callers' (ai gọi symbol), 'callees' (symbol gọi ai), 'impact' (phụ thuộc bị ảnh hưởng). Với callers/callees/impact, truyền tên symbol vào query và dùng subpath để chọn file định nghĩa khi tên bị trùng. Impact dùng depth 1–5 (mặc định 2). Các chế độ này yêu cầu index CodeGraph cục bộ.

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": {
      "project_id": "<project_id>",
      "mode": "<mode>"
    },
    "name": "investigate_codebase"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeYes
depthNo
queryNo
subpathNo
project_idYes
max_resultsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint and idempotentHint, so the safety profile is covered. The description adds genuinely useful context beyond that — a prerequisite local CodeGraph index for the symbol-aware modes and the Jedi backend for 'symbol' resolution — but says nothing about result limits, pagination, or what happens when no index exists (error vs empty result).

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?

Front-loaded with the mode list, then the cross-mode calling convention, then the depth note — a logical progression with no filler. It is dense single-paragraph prose with many parentheticals, which is efficient though slightly hard to scan.

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?

An output schema exists, so return values need not be described, and the index prerequisite plus depth default are covered. Against 6 parameters at 0% schema coverage, however, leaving project_id and max_results undefined and not clarifying query semantics for the non-symbol modes is a real gap for a tool this complex.

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 0%, so the description carries the full burden. It does explain query for callers/callees/impact and subpath's disambiguation role, and gives depth's range and default, but leaves project_id, max_results, and what query means in outline/grep/ast modes completely unexplained.

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?

The description enumerates all seven modes with a concrete gloss for each ('outline' = class/function signatures and docstrings, 'grep' = text/regex, 'callers' = who calls a symbol, etc.), so an agent knows exactly what operations are available. It does not contrast itself with the sibling tools (get_project_overview, inspect_evidence), but those are clearly unrelated, so the missing differentiation costs little.

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?

Strong mode-selection guidance: for callers/callees/impact the caller must put the symbol name in query and use subpath to pick the defining file when the name is ambiguous, and impact takes depth 1–5 with a default of 2. What is missing is any statement of when to prefer this tool over get_project_overview, or when-not to use it (e.g. no index available).

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