Skip to main content
Glama
putervision
by putervision

set_relation

Record or remove spatial relationships between entities in the world model to establish topological links like on, inside, or next_to without changing entity poses.

Instructions

Record or remove a spatial relationship between two entities. Actions: add, remove. Relations: on, inside, next_to, above, below, near, contains, occluded_by, connected_to, facing, holding, part_of, custom. This mutates the relation graph only, not entity poses. Returns {ok, relation}. Use set_relation instead of update_entity when establishing topological links (on, inside, contains) rather than setting entity coordinates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoAction to perform (default: add)
offsetNoRelative offset vector from source to target
projectNoOptional project identifier
distanceNoOptional measured distance between entities
metadataNoAdditional relation metadata
relationYesType of spatial relation
source_idYesSource entity ID
target_idYesTarget entity ID
bidirectionalNoIf true, automatically sets inverse relationship on target

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.1
    • addedInput schema / properties / action / enum
      Added value: +[
      +  "add",
      +  "remove"
      +]
  2. Changed5 schema fields changedv0.4.1
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / action / enum
      Removed value: -[
      -  "add",
      -  "remove"
      -]
    • removedInput schema / properties / metadata / additionalProperties
      Removed value: -{}
    • removedInput schema / properties / offset / additionalProperties
      Removed value: -true
  3. First observedv0.3.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, destructiveHint=false. The description adds real value beyond that: it clarifies that only the relation graph is mutated (not entity poses) and states the return shape {ok, relation}. It does not discuss idempotency semantics of add-vs-remove, but the scope clarification is substantive.

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?

Front-loaded with purpose and scope, then usage routing. The inline enumeration of all 13 relation values duplicates the schema enum, which is mild waste, but the rest is tight and each sentence earns its place.

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?

For a 9-param mutation tool with nested objects and no output schema, the description covers mutation scope, return shape, and alternative selection well. Undocumented areas (bidirectional auto-inverse, offset semantics) are fully described in the schema, so nothing critical is missing.

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 description coverage is 100%, so the schema already documents all 9 params. The description largely repeats the action and relation enums already present in the schema and adds no meaning for offset, distance, bidirectional, or metadata. Baseline 3 applies.

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?

States a specific verb pair (record/remove) and resource (spatial relationship between two entities), and immediately contrasts with update_entity. An agent can distinguish it from siblings 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 Guidelines5/5

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

Explicitly routes the agent: 'Use set_relation instead of update_entity when establishing topological links (on, inside, contains) rather than setting entity coordinates.' It names the alternative and the condition that selects it.

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