Skip to main content
Glama

define_relation

Define and validate a new user relation for a Markdown knowledge graph, appending it to relation-dictionary-user.yaml while checking name collisions and inverse or symmetric rules.

Instructions

Define a new user relation and append it to relation-dictionary-user.yaml. Returns {"defined": true, "name": str, "warnings": [...]} on success, or {"defined": false, "errors": [...], "warnings": [...]} if validation fails.

Rules enforced before writing:

  • name must not collide with any canonical or existing user relation

If inverse_of is provided and names an unknown relation, a warning is returned (not an error) — the inverse may be defined in a subsequent call.

Every relation needs an inverse or must be symmetric, or lint_vault warns. If inverse_of names a user relation with no inverse, that relation is updated to name this one back. A relation cannot be both symmetric and have inverse_of.

Args: name: New relation name (lowercase, hyphenated) description: What this relation means; include directionality in the wording group: Optional group label (e.g. "entity", "semantic", "custom") inverse_of: Optional name of the inverse relation symmetric: True when the relation is its own inverse (A relates B means B relates A)

Input Schema

NameRequiredDescriptionDefault
nameYes
groupNo
symmetricNo
inverse_ofNo
descriptionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations at all, the description carries the full burden and does so: it discloses the file written, that an existing user relation may be mutated to back-reference this one, that unknown inverse_of yields a warning rather than an error, and that warnings are returned in both success and failure payloads. It also documents both return shapes, so the agent knows exactly how validation failure surfaces.

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 the action and file, then return shapes, then enforcement rules, then argument semantics — a logical escalation. The return-shape lines are justified because no output schema exists, but the block is dense enough that the ordering between rules and args could blur on a quick read.

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?

For a five-parameter mutation with no annotations and no output schema, the definition covers the write target, validation gates, cross-relation side effects, warning-versus-error distinction, and both response shapes. An agent has everything needed to invoke it correctly and interpret the result.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate and it does: each of the five parameters gets meaning beyond the schema — name must be lowercase and hyphenated, description should encode directionality, group examples are given, inverse_of's resolution behavior is explained, and symmetric is defined in semantic terms. This is more than the schema's bare titles.

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?

States a specific verb and resource ("Define a new user relation") plus the exact persistence target (relation-dictionary-user.yaml), which separates it from the sibling define_type. It never explicitly names define_type or validate_type as the alternative, so the sibling differentiation is inferable rather than stated.

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?

Gives concrete preconditions: the name must not collide with canonical or existing user relations, every relation needs an inverse or must be symmetric, and symmetric cannot be combined with inverse_of. The lint_vault reference hints at the downstream validation workflow, but there is no explicit statement of when to call define_relation versus define_type or validate_type.

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