Skip to main content
Glama

set_relationship

Idempotent

Links two existing entities of the campaign: sourceId targetId, e.g. an NPC LOCATED_AT a location, a location LOCATED_AT its parent region, an NPC MEMBER_OF a faction. Only the relationship types declared for that pair of entity types are accepted; the error lists the allowed ones. LOCATED_AT replaces the entity's previous location. Requires the Editor role.

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": {
      "campaignId": "<campaignId>",
      "sourceId": "<sourceId>",
      "targetId": "<targetId>",
      "type": "<type>"
    },
    "name": "set_relationship"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeYesRelationship type: LOCATED_AT, MEMBER_OF, HELD_BY, ALLIED_WITH, OPPOSES, RELATES_TO, INVOLVED_IN, KNOWS_ABOUT or CATEGORIZED_AS.
sourceIdYes
targetIdYes
campaignIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations cover safety (idempotent, non-destructive, closed-world), and the description adds materially beyond them: it requires the Editor role, discloses that LOCATED_AT overwrites the entity's previous location, and explains the validation-failure behavior (error enumerates allowed types). The overwrite note is especially valuable given destructiveHint=false.

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?

Three compact sentences, front-loaded with the operation shape, then the validation rule, then the mutation side-effect and permission requirement. No filler; the examples and the LOCATED_AT caveat both earn their space.

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 four-required-parameter mutation with no output schema, the definition covers shape, examples, validation, side-effects, and auth. The only omissions are campaignId semantics and any hint about what the successful response contains, which are minor.

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 only 25% (just `type` documented), but the description compensates by explaining the source/target/type triple via a positional pattern and worked examples. campaignId is left unexplained beyond implicit campaign scoping, which is the remaining gap.

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 ('Links') and a precisely scoped resource ('two existing entities of the campaign'), then renders the shape as 'sourceId <type> targetId' with three concrete examples. It is trivially distinguishable from siblings like remove_relationship or create_entity.

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?

Makes clear the tool applies only to already-existing entities of a campaign and only for relationship types declared for that pair, with the error as fallback discovery. It does not explicitly name remove_relationship as the inverse or say when not to use it, so it falls just short of full alternative routing.

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