Skip to main content
Glama

relate

Record a structured subject-predicate-object relation directly, with optional source and valid-time details, so extracted relationships persist with provenance. Returns its resource name.

Instructions

Assert a structured (subject, predicate, object) relation directly. You are the extractor: when you see a relationship, record it here rather than relying on server-side extraction (off unless a chat model is configured). Pass source for provenance. Returns the new relation's resource name.

Input Schema

NameRequiredDescriptionDefault
scopeNoScope to write into — pick by who should see it. Defaults to personal (private to the user, syncs to their devices). Use "project" for edges tied to the current repo/codebase (shared with anyone who has repo access). Use "team" for the shared team brain (requires admitted membership, else E_PERMISSION). "draft" is private staging — invisible to recall until promoted via the CLI (maz scope draft promote); there is no listed MCP tool for draft promotion.
objectYesObject entity: entities/{uid}, a bare ULID, the literal "self", or a human display name (resolved case-insensitively, like maz get).
sourceNoProvenance label for the appended event, e.g. "cli:relate". Optional; defaults to "mcp:relate".
subjectYesSubject entity: entities/{uid}, a bare ULID, the literal "self", or a human display name (resolved case-insensitively, like maz get).
predicateYesRelationship type, e.g. works_at, reports_to, knows. See introspect for registered predicates.
validFromNoInclusive lower bound of the relation's valid-time (RFC 3339 UTC). Optional.
attributesNoQualifying key/value pairs, e.g. {"role":"CEO"}. Optional.
confidenceNoWriter confidence in the edge. Defaults to 1.0.
provenanceNoFree-text rationale for the edge. Optional.
validUntilNoExclusive upper bound of the relation's valid-time (RFC 3339 UTC). Optional.

Output Schema

NameRequiredDescriptionDefault
nameYesAIP resource name of the asserted Relation; pass to get(relations/{uid}).
statusYesAlways "asserted" on success.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations are empty, so the description carries the full burden. It usefully discloses the return value ('the new relation's resource name') and the server-side extraction context, but says nothing about duplicate/conflicting edges, whether entities are auto-created from display names, or permission failures on write — details that matter for a mutation tool with zero annotation coverage.

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?

Three short sentences that front-load the core action, then the usage rule, then the return value. No filler; the only slight redundancy is the 'Pass source for provenance' sentence, which duplicates the schema.

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 10 parameters, nested attributes, and an output schema, the description covers the action, the timing rule, provenance, and the return value, and the scope details live in the schema. Missing only notes on duplicate handling and relationship to unrelate/promoteRelation, which would round out a mutation tool.

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%, including a detailed scope enum and validFrom/validUntil semantics, so the baseline is 3. The description only adds 'Pass source for provenance', which is a marginal restatement of what the schema already documents.

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: 'Assert a structured (subject, predicate, object) relation directly,' which is unambiguous about what the tool creates. It does not name siblings such as fact, relateBatch, or promoteRelation, so the agent must infer the boundary from context rather than from the description.

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 an explicit trigger ('when you see a relationship, record it here') and an explicit alternative to avoid ('rather than relying on server-side extraction (off unless a chat model is configured)'). It lacks exclusions for the sibling write tools (relateBatch for bulk, promoteRelation for drafts), so the guidance is clear but not complete.

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