Skip to main content
Glama

repair_terrain

Repairs an empty terrain splat lost after a map resize mismatch, restoring a usable surface for repainting. Destructive: existing painted terrain is not recovered.

Instructions

Rebuild a level's terrain splat when the engine dropped it. Destructive.

Only needed on a map whose terrain has already been lost. Symptom: every
terrain call answers "the terrain splat image is empty", and Dungeondraft's
log carries `Expected data size of N bytes in Image::create()` at load.

That happens when a map was resized while its terrain was not. The splat
keeps the pixel dimensions it was created with, the mismatch is silent
until the map is next opened, and Godot then refuses the image and drops
every painted stroke — while the save that produced it reported success.
set_map_size now resizes the rasters with the map, so new maps do not reach
this state; this repairs one that already did.

It does not recover anything. The painted terrain is gone before this runs;
all it restores is a usable surface to paint on, so the terrain has to be
laid down again afterwards. Nothing else on the map is touched.

force: blank a splat that is already usable. This throws away working
  terrain, so it is off by default.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "repair_terrain"
  }
}

Input Schema

NameRequiredDescriptionDefault
forceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.5.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations supplied, the description carries the whole burden and does: it declares destructiveness up front, explains the root cause of the failure (resize/splat dimension mismatch silently rejected by Godot), and states clearly that nothing is recovered — only a paintable surface is restored. It also scopes the blast radius ("Nothing else on the map is touched"), which is exactly the reassurance a mutation tool without annotations needs.

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 critical facts — what it does, that it's destructive, and when it applies — are front-loaded in the first two sentences, and the force caveat is set off at the end. The middle paragraph on resize-then-silent-failure is longer than strictly required for invocation, though it does serve diagnosis, so it mostly earns its space.

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?

For a zero-required-parameter, one-optional-parameter mutation tool with no annotations and no output schema, the description covers trigger conditions, destructiveness, data-loss expectations, post-conditions (terrain must be repainted), and side-effect scope. Nothing an agent needs to decide or invoke correctly is missing.

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

Parameters5/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 define the sole parameter, and it does: force blanks an already-usable splat, warns that this discards working terrain, and confirms the default is off. That is more meaning than the schema's bare boolean plus default provides.

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 first sentence names a specific verb and resource ("Rebuild a level's terrain splat") plus the triggering condition ("when the engine dropped it"), and immediately flags it as destructive. The named symptom ("the terrain splat image is empty") and the log line distinguish it unambiguously from paint_terrain, fill_terrain, and set_map_size.

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

Usage Guidelines5/5

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

It states exactly when the tool is needed ("Only needed on a map whose terrain has already been lost") with a concrete diagnostic signature, and explicitly says new maps do not reach this state because set_map_size now resizes rasters. It also scopes the one parameter's use ("blank a splat that is already usable... off by default"), so an agent knows the default path and the exception.

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

Deploy Server

Other Tools