Skip to main content
Glama

find_symbol

Locate where a function, struct, enum value, or macro is defined or declared across Diablo II source sets, returning file paths and line numbers with definitions listed first.

Instructions

Find where a function, struct, enum value or macro is defined or declared, e.g. 'D2SkillsTxt' or 'STATLIST_GetUnitStatUnsigned'. Returns file paths and line numbers, definitions first. source: 'd2moo' (1.10f game code: D2Common, D2Game; clean, well named) or 'redivivus' (all of 1.14d decompiled into C++: game code plus D2Client, D2Win, D2gfx, D2Sound, D2Net, Storm, Fog; names are reconstructions) or 'd2hausos' (seperaGG's decompilation of all of 1.00, every DLL and EXE, byte-matching; 1.00 only, link it, no credit line) or 'pvpgn' (PvPGN, the private Battle.net and D2 realm server: bnetd, d2cs, d2dbs, and its conf/ templates) or 'd2ds' (jaenster's d2-dedicated-server, in Zig: headless d2gs for 1.06b to 1.14d, realmd, d2ingress). For 1.14d, 'iblis-codex' is Legbreak's byte-matching Game.exe reconstruction in C++, 'd2-114d-codex' has Nugwa628's research specs and Ghidra tools, and 'd2gamma' is Nugwa628's Rust reimplementation. The Diablo II: Resurrected sources (see search_code) work too, e.g. 'readJson' in 'd2rmm'.

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

Input Schema

NameRequiredDescriptionDefault
nameYes
sourceNod2moo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the burden. It does disclose genuinely useful behavior beyond the schema: the return contains file paths and line numbers, and results are ordered with definitions before declarations. It says nothing about read-only safety, result caps, pagination, or whether it searches declarations across headers as well as sources beyond the one clause about 'declared'.

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 first sentence is well front-loaded and earns its place, but the remainder is a sprawling, comma-spliced catalog of repositories with uneven formatting and an awkward late paragraph re-splitting the 1.14d sources. Given the 0% schema coverage the volume is defensible, yet it could be tightened considerably without losing 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?

An output schema exists, so return values need not be spelled out, and the description still sketches them helpfully. For a two-parameter lookup tool the source guidance is unusually thorough; the residual gap is undocumented enum members and the absence of any note on search scope or result limits.

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?

With 0% schema coverage the description must compensate, and it largely does: it glosses nine of the fifteen source enum values with real disambiguation (version, language, provenance, naming quality, e.g. d2hausos is '1.00 only, byte-matching'). The 'name' parameter is illustrated by concrete identifiers. It falls short of full coverage because six D2R-related enum values (d2rmm-mods, d2r-vanilla, d2r-howto, d2rl-plugins, d2r-spriteedit, d2rai-toolkit) are only waved at with 'see search_code'.

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 sentence names a precise verb-and-resource pair ('find where a function, struct, enum value or macro is defined or declared') and even specifies result shape ('Returns file paths and line numbers, definitions first'). The concrete examples ('D2SkillsTxt', 'STATLIST_GetUnitStatUnsigned') make the expected input form unambiguous and clearly separate it from a free-text search sibling like search_code.

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

Usage Guidelines3/5

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

Usage is implied through worked examples ('readJson' in 'd2rmm') and an indirect pointer to search_code for D2R sources, but there is no explicit statement of when to prefer this tool over search_code/decomp_search (e.g. exact identifier known vs. fuzzy text). The bulk of the guidance is about source selection, which belongs to parameter semantics rather than tool selection.

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