Skip to main content
Glama

search_code

Find source lines containing every query word (case-insensitive) with optional path filtering and return up to 40 file:line hits.

Instructions

Search the source for lines containing every word of the query (case-insensitive), e.g. 'srvdofunc'. Use it for column names from the data files, partial identifiers and comments. path optionally filters, e.g. 'D2Game/src/SKILLS' (D2MOO), 'D2Client/UI' (Redivivus), 'src/d2cs' (PvPGN), 'apps/realmd' (d2ds) or 'Layouts' (d2r-vanilla). Sources are as for find_symbol. For 1.14d, try 'Source/' in 'iblis-codex', 'specs/data' in 'd2-114d-codex' for TSV field layouts (also specs for formats, items, treasure, combat and monsters), or 'crates/' in 'd2gamma' for Rust. Cite d2gamma as a reimplementation. Returns up to 40 file:line hits. Diablo II: Resurrected modding sources (every result from them is D2R only, never Legacy or 1.13c): 'd2rmm' (D2RMM, the D2R mod manager: src/bridge/ModAPI.d.ts is the ModAPI that mod.js scripts call, D2RMM.readJson, writeJson, readTsv, writeTsv, readTxt, copyFile, getConfigJSON...; DOCS.md and README.md; and .claude/.md, its notes on D2R's files, mechanics, the modding API and mod examples), 'd2rmm-mods' (D2RMM's own example mods, each a mod.js plus mod.json config: expanded stash/cube/inventory, stackable runes, loot colours...), 'd2r-vanilla' (unmodded D2R files from patch 2.4/2.5, before 2.6 and Reign of the Warlock: Data/Global/UI/Layouts/.json, the UI layouts (hd and controller variants), Data/Local/Lng/strings/*.json, Additional Jsons/ items.json, uniques.json, sets.json (data/hd/items: item code to HD asset), missiles.json, monsters.json, plus 2.4's Excel .txt; read a JSON file by key with read_d2r_json), 'd2r-howto' (HighTechLowIQ's D2R modding guide: README.md walks through mod folders and -mod/-txt, new items with HD graphics, sets, stash tabs, maps, menus, runes, with the example mods' files under mods/), 'd2rl-plugins' (eezstreet's D2RLoader plugins for D2R 3.x and the ini options they add), 'd2r-spriteedit' (eezstreet's SpriteEdit: how D2R's .sprite format is read and written, in C#) and 'd2rai-toolkit' (Nugwa628's D2R engine, mechanics and format notes in knowledge/ and Python tools in modkit/).

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": {
      "query": "<query>"
    },
    "name": "search_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNo
queryYes
sourceNod2moo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and covers a lot: matching semantics (all words, case-insensitive), result limits ('Returns up to 40 file:line hits'), optional path filtering, and version-scope caveats (D2R-only sources). It omits failure behavior, whether results are ranked, and how decompiled vs raw source differ, which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core behavior is correctly front-loaded in the first two sentences, but the remainder is a dense, run-on catalog of sources with nested parentheticals and an unclosed quote in the path example. Much of the source detail earns its place given 0% schema coverage, yet the packing and formatting make it harder to scan than necessary.

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 shape needn't be explained, and the description still adds the useful 'up to 40 file:line hits' bound. Coverage of query/path/source is strong for a 3-parameter tool; the only real hole is the unexplained 'd2hausos' source and the unstated default source value.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate, and it largely does: 'query' semantics are spelled out (every word, case-insensitive), 'path' is described as an optional filter with concrete per-source examples, and most enum values are given content descriptions. Gaps remain: 'd2hausos' is never described anywhere and the default source ('d2moo') is not stated.

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 verb and resource with mechanics: 'Search the source for lines containing every word of the query (case-insensitive)', with an example query and an example path. It hints at a sibling relationship ('Sources are as for find_symbol') and contrasts implicitly with symbol lookup by recommending it for 'column names... partial identifiers and comments'. Not a full explicit sibling differentiation, but an agent can tell what this does.

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 clear when-to-use guidance ('Use it for column names from the data files, partial identifiers and comments') and per-source routing advice, e.g. 'For 1.14d, try Source/ in iblis-codex' or 'specs/data in d2-114d-codex for TSV field layouts'. It also warns that D2R sources never yield Legacy/1.13c results and that d2gamma should be cited as a reimplementation. No explicit when-not-to-use or direct named alternative, so not a 5.

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