Skip to main content
Glama

update_terrain

Modify terrain types like obstacles, difficult terrain, or water in RPG encounters using efficient range-based operations for lines, shapes, and algebraic expressions.

Instructions

Add, remove, or modify terrain in an active encounter. ALWAYS prefer ranges over tiles arrays for efficiency.

TERRAIN TYPES:

  • obstacles: Blocking terrain (walls, rocks, fallen trees)

  • difficultTerrain: Half-speed terrain (mud, rubble, underbrush)

  • water: Watery terrain (streams, rivers, pools)

INPUT OPTIONS (use ranges for efficiency):

  1. ranges: Array of range shortcuts (PREFERRED - saves tokens)

  2. tiles: Array of "x,y" strings (only for specific scattered tiles)

RANGE SHORTCUTS (use these!):

LINES:

  • "x=N" - vertical line at x=N (full height)

  • "x=N:y1:y2" - vertical line segment

  • "y=N" - horizontal line at y=N (full width)

  • "y=N:x1:x2" - horizontal line segment

  • "line:x1,y1,x2,y2" - diagonal/any line from point to point (Bresenham)

  • "hline:y:x1:x2" - horizontal line

  • "vline:x:y1:y2" - vertical line

  • "row:N" / "col:N" - aliases for y=N / x=N

SHAPES:

  • "rect:x,y,w,h" - filled rectangle

  • "box:x,y,w,h" - hollow rectangle (border only)

  • "border:margin" - outer border of grid (margin=0 for edge)

  • "fill:x1,y1,x2,y2" - fill between two corners

  • "circle:cx,cy,r" - filled circle

  • "ring:cx,cy,r" - hollow circle

ALGEBRA (for curves, diagonals):

  • "y=x:0:99" - diagonal line (y equals x)

  • "y=2*x+5:0:50" - any linear equation

  • "y=x/2:0:99" - half-speed diagonal

  • "expr:EQUATION:xMin:xMax" - explicit expression format

EXAMPLES:

Maze outer walls (1 call vs 4): { "ranges": ["border:0"], "gridWidth": 100, "gridHeight": 100 }

Complex maze section: { "ranges": ["y=10:0:50", "x=25:10:40", "line:50,50,75,25", "box:60,60,15,15"] }

Diagonal river: { "terrainType": "water", "ranges": ["y=x:0:99"] }

Circular arena: { "ranges": ["ring:50,50,40", "border:0"] }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses key behavioral traits: the tool modifies terrain in an active encounter (implying mutation), emphasizes efficiency considerations (preferring ranges), and provides detailed examples of input formats and terrain types. However, it doesn't mention permissions, error handling, or response format, leaving some gaps in behavioral context.

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 description is appropriately front-loaded with the core purpose and key guideline, but it becomes lengthy with detailed lists of terrain types, range shortcuts, and examples. While informative, some sections (e.g., extensive shortcut lists) could be condensed or structured more efficiently without losing clarity, making it somewhat verbose.

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?

Given the complexity of terrain modification and the lack of annotations and output schema, the description is largely complete. It covers purpose, usage, input semantics, and examples. However, it doesn't explain the return values or error conditions, which are important for a mutation tool with no output schema, leaving a minor gap in completeness.

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?

The input schema has 0 parameters with 100% coverage, so no parameters are documented in the schema. The description compensates fully by detailing input options (ranges and tiles), providing extensive examples, and explaining terrain types and range shortcuts. This adds significant semantic value beyond the empty schema.

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 explicitly states the tool's purpose: 'Add, remove, or modify terrain in an active encounter.' It clearly distinguishes this from sibling tools by specifying the resource (terrain) and the context (active encounter), which no other sibling tool addresses. The description goes beyond the tool name by detailing the types of terrain modifications possible.

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?

The description provides explicit guidance on when to use this tool: 'ALWAYS prefer ranges over tiles arrays for efficiency.' It also distinguishes between input options (ranges vs. tiles) and specifies that ranges are preferred for efficiency, giving clear alternatives within the tool's usage. This helps the agent choose the most effective approach.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Mnehmos/rpg-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server