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
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | Scope 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. | |
| object | Yes | Object entity: entities/{uid}, a bare ULID, the literal "self", or a human display name (resolved case-insensitively, like maz get). | |
| source | No | Provenance label for the appended event, e.g. "cli:relate". Optional; defaults to "mcp:relate". | |
| subject | Yes | Subject entity: entities/{uid}, a bare ULID, the literal "self", or a human display name (resolved case-insensitively, like maz get). | |
| predicate | Yes | Relationship type, e.g. works_at, reports_to, knows. See introspect for registered predicates. | |
| validFrom | No | Inclusive lower bound of the relation's valid-time (RFC 3339 UTC). Optional. | |
| attributes | No | Qualifying key/value pairs, e.g. {"role":"CEO"}. Optional. | |
| confidence | No | Writer confidence in the edge. Defaults to 1.0. | |
| provenance | No | Free-text rationale for the edge. Optional. | |
| validUntil | No | Exclusive upper bound of the relation's valid-time (RFC 3339 UTC). Optional. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | AIP resource name of the asserted Relation; pass to get(relations/{uid}). | |
| status | Yes | Always "asserted" on success. |