Skip to main content
Glama

get_tilemap_info

Read-only

Describe a tilemap layer's grid and read the tile indices placed in a frame, including flipped cells; use an optional rectangle to limit the region.

Instructions

Describe a tilemap layer and read the tile indices placed in a frame.

The grid is the layer's own tileset grid: tile_size, origin, and the columns and rows that cover the canvas. tile_count includes tile 0, the empty tile. cel gives the frame's tilemap cel in cells (null without one). tiles holds one list of indices per row of the region (0 where nothing is placed); flags lists flipped cells. At most 4096 cells per call.

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>",
      "layer": "<layer>"
    },
    "name": "get_tilemap_info"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesSprite file. Relative paths resolve against the server root.
rectNoCells to read, in tiles: x=col, y=row, w and h; default whole grid
frameNo1-based frame number
layerYesTilemap layer name or 'group/child' path

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

readOnlyHint=true already marks this as a safe read, yet the description still adds real behavior: the grid is the layer's own tileset grid, tile_count includes empty tile 0, cel is null when absent, tiles use 0 for empty cells, flags mark flipped cells, and there is a hard 4096-cell ceiling per call. It stops short of stating prerequisites (e.g. does the layer need to be a tilemap layer) or error behavior, so it is strong but not exhaustive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The one-line purpose leads, and the follow-up paragraph is dense with load-bearing detail (grid definition, sentinel values, limits) with no filler or restated boilerplate.

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?

With four parameters, an output schema, and readOnlyHint, this is complete: return-field semantics, null/zero sentinels, and the per-call size cap are all covered, so an agent can call it correctly on the first attempt.

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, but the description earns a bump by clarifying that the rect's cells are expressed in the layer's own tileset grid and that omitting rect reads the whole canvas-covering grid, which refines what rect/w/h actually address.

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 opens with a specific verb and resource: 'Describe a tilemap layer and read the tile indices placed in a frame.' That is precise enough to separate it from get_sprite_info or the draw_* siblings without opening any schema.

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

Usage Guidelines3/5

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

Usage is only implied: the reader can infer this is the read tool for tilemap layers and that the 4096-cell cap forces rect-based paging, but no when-to-use, when-not, or named alternative is stated.

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