Skip to main content
Glama

read_materials

Read a compiled BSP's material table to see every referenced texture and its exact TEXINFO reuse count, revealing which materials a map employs and which cover most surfaces.

Instructions

Material table of a compiled map: every texture referenced by a TEXINFO, and how many TEXINFO entries reuse it -- the only accurate reuse count in the file. Reads TEXDATA, TEXDATA_STRING_TABLE, TEXDATA_STRING_DATA and TEXINFO by offset, never the whole map. Answers which materials a map actually employs, and which carry the bulk of its surfaces.

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

Input Schema

NameRequiredDescriptionDefault
pathYesPath to the .bsp, absolute or relative to the repo root.
limitNo
sortByNousage: most-referenced material first. name: alphabetical.usage
nameContainsNoCase-insensitive substring filter on the material path.

Output Schema

NameRequiredDescriptionDefault
pathYes
returnedYes
materialsYes
texdataCountYes
texinfoCountYes
materialCountYesDistinct material names, after filtering.
unattributedTexinfoYesTEXINFO entries whose texdata index is out of range -- normally zero.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.24-alpha

TDQS

A4.1/5.0
Behavior4/5

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

Annotations carry only a title, so the description bears the behavioral burden, and it does real work: it discloses that the tool reads TEXDATA, TEXDATA_STRING_TABLE, TEXDATA_STRING_DATA and TEXINFO by offset and 'never the whole map', which is meaningful cost/IO information. It does not cover error behavior or whether the count is deduplicated per surface versus per TEXINFO entry, keeping it out of 5 territory.

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?

The core definition is front-loaded in the first clause, and the lump enumeration is dense but earns its place by explaining the partial-read behavior. It is jargon-heavy but the jargon is the domain, and there is no filler or restatement of the title.

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?

For a read-only BSP inspector with an output schema already defining return values, the description covers purpose, data source, read strategy and the question it answers. The remaining gap is operational: no note on behavior when a lump is absent or when the path is a VMF rather than a compiled .bsp.

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 75% with path, sortBy and nameContains described in the schema, and the description adds nothing parameter-specific beyond implying that 'reuse' is the default ordering. With the schema doing most of the parameter documentation, the baseline 3 applies.

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 description names a specific resource ('Material table of a compiled map') and the exact semantics of what it returns: every texture referenced by a TEXINFO plus its reuse count. It also carves out a distinctive claim ('the only accurate reuse count in the file') that separates it from any sibling that might enumerate dependencies or pak contents.

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?

It gives a clear use context -- 'Answers which materials a map actually employs, and which carry the bulk of its surfaces' -- which tells an agent exactly what question this tool answers. It stops short of naming alternatives (e.g. dependency or pakfile readers) or stating when not to use it, so it is a strong 4 rather than a 5.

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