Skip to main content
Glama

get_bounds

Read-only

Measure the bounding box of non-transparent pixels per frame and across all frames in a sprite, using either the visible composite or a single layer's own pixels.

Instructions

The box around the non-transparent pixels of each frame, and around all of them.

Bounds are {x, y, w, h} in canvas coordinates, clipped to the canvas; null for an empty frame. Without layer the visible composite is measured, with layer that layer's own pixels.

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

Input Schema

NameRequiredDescriptionDefault
pathYesSprite file. Relative paths resolve against the server root.
layerNoLayer name or 'group/child' path for that layer's own pixels; omit for the visible layers composited
framesNoFrames: a number, "1-4", "1-4,7" or "all" (1-based)all

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so safety is covered. The description adds genuinely useful behavior beyond that: coordinates are in canvas space, results are clipped to the canvas, and an empty frame yields null. It does not discuss cost, per-frame ordering, or how the aggregate box is derived, which is a modest but real gap.

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?

Compact and front-loaded, with the output shape and edge cases stated immediately. The opening sentence is slightly awkwardly phrased ('and around all of them'), but no sentence is wasted.

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?

With an output schema present, the description need not spell out return values, and it still explains the {x, y, w, h} form, clipping, and the null case. Combined with 100% schema coverage on three parameters, an agent has everything needed to call it correctly.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so path, layer, and frames are already documented in the schema. The description restates the layer semantics (visible composite vs. a single layer's own pixels) that the schema already explains, and says nothing about the frames selector. Baseline 3 applies where the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names the specific resource measured — the bounding box around non-transparent pixels — and clarifies it is returned per frame as well as aggregated across all frames. It is unambiguous what the tool computes, though it never explicitly contrasts itself with sibling measurement tools such as get_color_stats or get_sprite_info.

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 layer/no-layer sentence tells the caller which mode to pick, but there is no explicit when-to-use-this-instead-of-X guidance and no stated prerequisites. An agent can infer intent from the layer semantics, but nothing steers it away from alternatives.

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