Skip to main content
Glama

set_lightmap_scale

Sets lightmap scale on selected VMF faces by solid, material, facing, or area, reporting luxel counts before and after writing. Warns when faces exceed 32 luxels per axis, which makes vbsp split them.

Instructions

Sets lightmapscale on selected faces of a .vmf. The value is units per luxel, so it runs backwards from intuition: smaller is finer and more expensive, and the cost is an area -- halving the scale quadruples the luxels on that face. Select by solid, by material, by which way a face points, by minimum area, or a combination. Reports the luxel count before and after, per face and in total, before writing. Warns when a face would cross MAX_BRUSH_LIGHTMAP_DIM_WITHOUT_BORDER (32 luxels per texture axis, read from bspfile.h): vbsp does not refuse that, it splits the face until each piece fits, so the bill includes extra faces and not only extra luxels. Verify with read_lightmap_budget on the recompiled map.

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>",
      "scale": "<scale>"
    },
    "name": "set_lightmap_scale"
  }
}

Input Schema

NameRequiredDescriptionDefault
allNoRequired to act on every face of the map when no other selector is given.
pathYesPath to the .vmf, absolute or relative to the repo root.
scaleYesUnits per luxel. Hammer's default is 16; powers of two are the convention.
backupNoCopy the file to <file>.bak before writing. Nothing is copied on a no-op.
dryRunNoCheck and report without writing. Every verification runs either way.
facingNoOnly faces pointing this way: up is a floor, down a ceiling, side a wall.
confirmNoRequired (true) to run this tool: it writes or executes.
minAreaNoOnly faces of at least this many square units.
materialNoOnly faces whose material contains this text.
solidIdsNoOnly faces of these solids.

Output Schema

NameRequiredDescriptionDefault
pathYes
changedYes
writtenYes
nextStepYes
warningsYes
truncatedYes
unchangedYes
backupPathYes
luxelsAfterYes
facesChangedYes
facesOverCapYes
luxelsBeforeYes
alreadyAtScaleYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.24-alpha

TDQS

A4.6/5.0
Behavior5/5

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

With only a title annotation, this description carries the full burden and delivers: the reversed scale semantics, the quadratic-ish cost model ('halving the scale quadruples the luxels'), the two-phase report-before-write behavior, and the MAX_BRUSH_LIGHTMAP_DIM_WITHOUT_BORDER warning plus vbsp's face-splitting consequence. That is exactly the kind of non-obvious behavioral detail annotations cannot convey.

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?

Front-loaded with the action, then the semantic trap (backwards units), then selectors, then behavior, then verification. Dense multi-clause sentences with parenthetical asides cost it a little, but almost every clause carries operational information.

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?

Ten parameters, mutation semantics, and an output schema — the description covers cost model, warning thresholds, reporting behavior, and the verification loop, while return values are covered by the output schema. Nothing an agent needs to call this correctly is missing.

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 coverage is 100%, so the baseline is 3; the description still adds genuine meaning by explaining that scale is 'units per luxel' and runs backwards from intuition, and by grouping the selectors (solid/material/facing/minArea/combination) into a mental model. It does not cover the required confirm flag or dryRun/all interplay, so not a 5.

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?

Specific verb and resource: 'Sets lightmapscale on selected faces of a .vmf.' It also names the selector axes and points at the read-only sibling read_lightmap_budget for verification, so an agent can place it precisely against the read/verify tool.

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 explicit operating context: choice of selectors (solid, material, facing, minArea, or combination) and the follow-up step 'Verify with read_lightmap_budget on the recompiled map.' It never states when NOT to use it (e.g. read-only budget inspection, BSP-side edits), so it is clear context without exclusions.

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