read_game_content
Searches installed L4D2 content for materials, models, and particles by name or glob, returning canonical names for mapping tools and optionally validating referenced textures or model bounds.
Instructions
Searches the game's installed content for materials and models, by name. This is Hammer's texture browser and model browser, which an agent otherwise does not have: without it a material is named from memory, and vbsp resolves a name literally, so a wrong one is a purple checkerboard nobody sees until a player loads the map. Returns material names in the form a .vmf stores -- uppercase, no materials/ prefix, no .vmt suffix -- which is exactly what set_face_material takes. A pattern with * or ? is a glob; anything else is a substring. Mounts the same VPK-and-loose chain the engine reads through, so this and read_map_dependencies cannot disagree about what exists. A .vmt being present is NOT the same as the material drawing: a material can name a texture this install does not have, which is the same purple checkerboard by another route. Pass details to resolve every texture a material names, or to read a model's hull bounds -- the size Hammer's model viewer shows and the number needed before placing a house on the floor. Needs the Python sidecar; see health.
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": {
"pattern": "<pattern>"
},
"name": "read_game_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| game | No | Game profile id. This fork supports only 'l4d2', which is also the default; any other id is refused rather than answered about the wrong game. | |
| kind | No | Materials (.vmt), models (.mdl) or particle systems (.pcf). | material |
| limit | No | ||
| details | No | Read the .vmt of each result for its shader, its surface property, and whether every texture it names actually exists in this install. Off by default: a Garry's Mod install holds tens of thousands, and parsing them all to answer one search would cost seconds. | |
| pattern | Yes | Name to look for. 'brick' matches anything containing it; 'brick*' is a glob. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| game | Yes | ||
| kind | Yes | ||
| note | No | ||
| shown | No | ||
| total | Yes | ||
| gameDir | Yes | ||
| mounted | Yes | ||
| pattern | Yes | ||
| refused | No | ||
| results | Yes | ||
| truncated | No | ||
| mountError | Yes |