Skip to main content
Glama
Infinite Code Next

Infinite Code Next

by Kawai-Senpai

investigate

Search code and project knowledge together to return evidence-backed leads for debugging, designing, or modifying source.

Instructions

Find code and project knowledge, with evidence to guide source review.

WHEN TO USE: before investigating, diagnosing, designing or modifying anything. Include a qualified symbol, path, config key, or error text when available. Broad natural-language results are leads. If matches are weak or empty, check index_state and search the repository directly. Read relevant source and tests before making claims or edits. A partial index can omit symbols, and a ready index can still miss relevant results. AFTER THIS: graph(action='impact') if you are about to change a symbol; investigate(action='why', symbol=...) before deleting something load-bearing; record() once you have verified something.

Searches code and knowledge together - lexical, symbol, code graph, memory graph, anchor status and git history - and returns compact capsules under a token budget rather than file dumps. Direct matches without a code anchor can appear in repo_memories. The conversations section is what past sessions from any coding agent (Codex, Claude Code, Copilot, Cursor, ...) said about the same terms while working in this repository: leads to follow with conversations(action='get'), not anchored facts.

Actions: search (default) run an investigation. expand drill into a prior investigation without restarting it. verify re-verify anchors for this repository right now. why reconstruct why one symbol exists, as a causal chain: decision -> bug -> failed fix -> accepted fix -> invariant -> test.

Args: query: task in plain language, with any known symbol, path, or exact term. A standalone path:line or path:line:column locates the indexed symbol at that source location. intent: locate | understand | modify | debug | audit. Inferred if omitted. root: primary repository path. Defaults to the server's working directory. roots: explicit repository paths for one bounded multi-repository search. depth: graph expansion hops from the seed set. budget: approximate token ceiling for the returned capsules. find_problems: run targeted checks over the narrowed subgraph. cross_repos: also follow contract edges into other repositories and report their active warnings. Reads the central catalog only, so it works even when those repositories are missing. conversations: also search past agent transcripts scoped to this repository. Off skips the transcript index entirely. use_concepts: use reviewed phrases from .icn-concepts.json. Grounding lists matched phrases, target status, and terms unmapped by the glossary. action: search, expand, or verify. investigation_id: required for expand. focus: what to drill into, for expand. symbol: the symbol to explain, for action="why".

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "investigate"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootNo
depthNo
focusNo
queryNo
rootsNo
actionNosearch
budgetNo
intentNo
symbolNo
cross_reposNo
use_conceptsNo
conversationsNo
find_problemsNo
investigation_idNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it discloses that results are compact capsules under a token budget rather than file dumps, that unanchored matches land in repo_memories, that conversations are unanchored leads, and that a partial or even ready index can omit relevant symbols.

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?

Purpose, WHEN TO USE, and AFTER THIS are front-loaded before the action and argument detail, which suits an agent's scan order. It is long but mostly earns its length for a 14-parameter, 4-action tool, though a few lines are redundant, such as the near-duplicate caveats about partial vs. ready indexes missing results.

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?

For a complex multi-action search tool, the definition covers triggers, follow-up routing, the four actions, return shape, and index caveats, so an agent has enough to call it correctly. Return values are further backed by an output schema, yet the description still summarizes capsule behavior usefully.

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 must define all 14 parameters, and it does — query, intent with its value set, root/roots, depth, budget, find_problems, cross_repos, conversations, use_concepts, action, investigation_id, focus, and symbol all get meaning beyond their bare names. The only blemish is the args line listing action as "search, expand, or verify" while the Actions block also documents a "why" action.

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?

The opening line gives a specific verb and resource ("Find code and project knowledge") and the follow-up enumerates the sources searched (lexical, symbol, code graph, memory graph, anchor status, git history). It distinguishes itself from siblings by name, routing to graph(action='impact'), record(), and conversations(action='get') for their respective jobs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"WHEN TO USE" gives an explicit trigger, and "AFTER THIS" spells out the follow-up tool for three concrete situations (changing a symbol, deleting something load-bearing, having verified a fact). It also covers the failure path: if matches are weak or empty, check index_state and search the repository directly.

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