Skip to main content
Glama

Set an asset's collision body

set_asset_collision_body

FREE and SYNCHRONOUS (no jobId — do not poll). Author the PHYSICS shape a game should build its collider from for an asset revision: rect, circle, polygon, compound of 1..16 simple disconnected bodies, or none, in NORMALIZED coordinates (0..1 fractions of the sprite/tile cell, origin top-left; a circle radius is a fraction of WIDTH). Set tileIndex to give one tile of a tileset/staged asset its own shape — it overrides the asset-level default for that tile. Pass collisionBody: null to clear/inherit, or {kind:"none"} to explicitly disable collision including bbox fallback. Compound children use the same cell space; preserve open archways between them.

This is what stops a game from falling back to the sprite bounding box. The shape flows into every map and asset export made AFTER this edit — Tiled per-tile objectgroups, the Tiled map Collision layer, and the Phaser/Godot/Unity/GameMaker colliders — and it is resolved from the asset at export time, so it applies to tiles that were already placed on a map before you set it. Distinct from the FOOTPRINT, which is only the level editor's snap/tessellation shape and has no physics meaning.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetIdYesAsset id or slug.
tileIndexNoTarget one collection tile (tileset/staged/terrain). Coordinates are normalized to its padded presentation cell, not the cropped item image. Omit for the asset-level default.
iterationIdYesRevision (iteration) id to stamp.
collisionBodyYesNormalized asset shape, compound of 1..16 simple shapes, explicit none for passable scenery, or null to clear/inherit.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / collisionBody / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "cx": {
      -        "description": "Center X, fraction of width.",
      -        "type": "number"
      -      },
      -      "cy": {
      -        "description": "Center Y, fraction of height.",
      -        "type": "number"
      -      },
      -      "hh": {
      -        "description": "Half-height, fraction of height.",
      -        "type": "number"
      -      },
      -      "hw": {
      -        "description": "Half-width, fraction of width.",
      -        "type": "number"
      -      },
      -      "kind": {
      -        "const": "rect",
      -        "type": "string"
      -      },
      -      "rot": {
      -        "description": "Rotation in radians about the body center.",
      -        "type": "number"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "cx",
      -      "cy",
      -      "hw",
      -      "hh"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "cx": {
      -        "type": "number"
      -      },
      -      "cy": {
      -        "type": "number"
      -      },
      -      "kind": {
      -        "const": "circle",
      -        "type": "string"
      -      },
      -      "r": {
      -        "description": "Radius, fraction of WIDTH.",
      -        "type": "number"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "cx",
      -      "cy",
      -      "r"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "kind": {
      -        "const": "polygon",
      -        "type": "string"
      -      },
      -      "points": {
      -        "description": "3..64 points, each a 0..1 fraction. Treated as a closed loop — do not repeat the first point.",
      -        "items": {
      -          "additionalProperties": false,
      -          "properties": {
      -            "x": {
      -              "type": "number"
      -            },
      -            "y": {
      -              "type": "number"
      -            }
      -          },
      -          "required": [
      -            "x",
      -            "y"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      },
      -      "rot": {
      -        "type": "number"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "points"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "anyOf": [
      +      {
      +        "anyOf": [
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "cx": {
      +                "maximum": 1,
      +                "minimum": 0,
      +                "type": "number"
      +              },
      +              "cy": {
      +                "maximum": 1,
      +                "minimum": 0,
      +                "type": "number"
      +              },
      +              "hh": {
      +                "exclusiveMinimum": 0,
      +                "type": "number"
      +              },
      +              "hw": {
      +                "exclusiveMinimum": 0,
      +                "type": "number"
      +              },
      +              "kind": {
      +                "const": "rect",
      +                "type": "string"
      +              },
      +              "rot": {
      +                "type": "number"
      +              }
      +            },
      +            "required": [
      +              "kind",
      +              "cx",
      +              "cy",
      +              "hw",
      +              "hh"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "cx": {
      +                "maximum": 1,
      +                "minimum": 0,
      +                "type": "number"
      +              },
      +              "cy": {
      +                "maximum": 1,
      +                "minimum": 0,
      +                "type": "number"
      +              },
      +              "kind": {
      +                "const": "circle",
      +                "type": "string"
      +              },
      +              "r": {
      +                "exclusiveMinimum": 0,
      +                "type": "number"
      +              }
      +            },
      +            "required": [
      +              "kind",
      +              "cx",
      +              "cy",
      +              "r"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "kind": {
      +                "const": "polygon",
      +                "type": "string"
      +              },
      +              "points": {
      +                "items": {
      +                  "additionalProperties": false,
      +                  "properties": {
      +                    "x": {
      +                      "maximum": 1,
      +                      "minimum": 0,
      +                      "type": "number"
      +                    },
      +                    "y": {
      +                      "maximum": 1,
      +                      "minimum": 0,
      +                      "type": "number"
      +                    }
      +                  },
      +                  "required": [
      +                    "x",
      +                    "y"
      +                  ],
      +                  "type": "object"
      +                },
      +                "maxItems": 64,
      +                "minItems": 3,
      +                "type": "array"
      +              },
      +              "rot": {
      +                "type": "number"
      +              }
      +            },
      +            "required": [
      +              "kind",
      +              "points"
      +            ],
      +            "type": "object"
      +          }
      +        ]
      +      },
      +      {
      +        "additionalProperties": false,
      +        "properties": {
      +          "bodies": {
      +            "items": {
      +              "anyOf": [
      +                {
      +                  "additionalProperties": false,
      +                  "properties": {
      +                    "cx": {
      +                      "maximum": 1,
      +                      "minimum": 0,
      +                      "type": "number"
      +                    },
      +                    "cy": {
      +                      "maximum": 1,
      +                      "minimum": 0,
      +                      "type": "number"
      +                    },
      +                    "hh": {
      +                      "exclusiveMinimum": 0,
      +                      "type": "number"
      +                    },
      +                    "hw": {
      +                      "exclusiveMinimum": 0,
      +                      "type": "number"
      +                    },
      +                    "kind": {
      +                      "const": "rect",
      +                      "type": "string"
      +                    },
      +                    "rot": {
      +                      "type": "number"
      +                    }
      +                  },
      +                  "required": [
      +                    "kind",
      +                    "cx",
      +                    "cy",
      +                    "hw",
      +                    "hh"
      +                  ],
      +                  "type": "object"
      +                },
      +                {
      +                  "additionalProperties": false,
      +                  "properties": {
      +                    "cx": {
      +                      "maximum": 1,
      +                      "minimum": 0,
      +                      "type": "number"
      +                    },
      +                    "cy": {
      +                      "maximum": 1,
      +                      "minimum": 0,
      +                      "type": "number"
      +                    },
      +                    "kind": {
      +                      "const": "circle",
      +                      "type": "string"
      +                    },
      +                    "r": {
      +                      "exclusiveMinimum": 0,
      +                      "type": "number"
      +                    }
      +                  },
      +                  "required": [
      +                    "kind",
      +                    "cx",
      +                    "cy",
      +                    "r"
      +                  ],
      +                  "type": "object"
      +                },
      +                {
      +                  "additionalProperties": false,
      +                  "properties": {
      +                    "kind": {
      +                      "const": "polygon",
      +                      "type": "string"
      +                    },
      +                    "points": {
      +                      "items": {
      +                        "additionalProperties": false,
      +                        "properties": {
      +                          "x": {
      +                            "maximum": 1,
      +                            "minimum": 0,
      +                            "type": "number"
      +                          },
      +                          "y": {
      +                            "maximum": 1,
      +                            "minimum": 0,
      +                            "type": "number"
      +                          }
      +                        },
      +                        "required": [
      +                          "x",
      +                          "y"
      +                        ],
      +                        "type": "object"
      +                      },
      +                      "maxItems": 64,
      +                      "minItems": 3,
      +                      "type": "array"
      +                    },
      +                    "rot": {
      +                      "type": "number"
      +                    }
      +                  },
      +                  "required": [
      +                    "kind",
      +                    "points"
      +                  ],
      +                  "type": "object"
      +                }
      +              ]
      +            },
      +            "maxItems": 16,
      +            "minItems": 1,
      +            "type": "array"
      +          },
      +          "kind": {
      +            "const": "compound",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "kind",
      +          "bodies"
      +        ],
      +        "type": "object"
      +      },
      +      {
      +        "additionalProperties": false,
      +        "properties": {
      +          "kind": {
      +            "const": "none",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "kind"
      +        ],
      +        "type": "object"
      +      }
      +    ],
      +    "description": "Reusable asset collider. All child coordinates are fractions of the same sprite/cell; circle radius is a fraction of width. Compound children are separate solids, not a filled bounding box. None explicitly disables collision; null/omission follows endpoint inheritance rules."
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / collisionBody / description
      Previous value: -"The shape, or null to clear it."New value: +"Normalized asset shape, compound of 1..16 simple shapes, explicit none for passable scenery, or null to clear/inherit."
  2. Changed1 schema field changed
    • changedInput schema / properties / tileIndex / description
      Previous value: -"Target one tile (tileset/staged only). Omit for the asset-level default."New value: +"Target one collection tile (tileset/staged/terrain). Coordinates are normalized to its padded presentation cell, not the cropped item image. Omit for the asset-level default."
  3. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations declare readOnly=false and idempotent=false, and the description goes well beyond them: it discloses that the call is FREE and SYNCHRONOUS with no jobId and must not be polled, and that edits are resolved at export time so they retroactively apply to already-placed tiles. It also spells out exactly what null (clear/inherit) versus {kind:'none'} (disable including bbox fallback) does.

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?

It is front-loaded with the highest-value facts (free, synchronous, no polling) before the shape semantics and export effects. It is dense and long for a tool description, and the final export-target sentence is somewhat crowded, but each sentence carries information an agent needs.

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 no output schema, the description covers the mutation's downstream effects (Tiled objectgroups, Collision layer, Phaser/Godot/Unity/GameMaker colliders), the tile-vs-asset scoping, and the null/none escape hatches, leaving no material ambiguity for correct invocation.

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 adds semantics the schema does not: coordinates are normalized 0..1 with a top-left origin, a circle radius is a fraction of WIDTH, compound children share the same cell space and must preserve open archways, and tileIndex overrides the asset-level default for one tile. Some of this (null inheritance, compound-as-separate-solids) duplicates the nested schema descriptions, keeping it short of 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?

The description names a specific verb+resource ('author the PHYSICS shape a game should build its collider from') and enumerates the shape kinds (rect, circle, polygon, compound, none). It further distinguishes this from the FOOTPRINT concept and from the collision-roles sibling, so an agent can identify the tool without opening the schema.

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?

It states the triggering condition clearly ('this is what stops a game from falling back to the sprite bounding box') and explains the tileIndex override path plus the null-vs-none choice. It does not, however, explicitly route the agent against sibling tools such as set_asset_collision_roles, so the when-not is only implicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources