reference
Mint or return a stable local external_ref for a URI, then relate local records to it as their primary source. Idempotent per scope; it does not fetch the URI.
Instructions
Mint-or-return an external_ref entity for a URI: a first-class local pointer to information held in another system (a GitHub issue, a Drive doc, a Granola transcript, a repo file). Returns the external_ref's resource name so you can relate(localEntity, has_primary_source, name) to record that a local record is grounded in it. Idempotent: the same URI in the same scope returns the same entity. Defaults to personal scope (local, not rendered to the shared project git tree); pass scope=project to share. Mazarbul does NOT fetch the URI — to make the referenced content searchable, fetch it with your own tools, remember() it, then reference() the URI and relate the two. Returns E_VALIDATION on a URI with no scheme or an unknown scope.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uri | Yes | Absolute URI of the external thing, e.g. https://github.com/org/repo/issues/42, mailto:a@b.com, or a connector URL. Must carry a scheme. | |
| label | No | Optional human-readable display name. Defaults to the URI. Keep third-party identity metadata out of project (git-rendered) scope. | |
| scope | No | Scope to write into. Defaults to personal (local, not rendered to the shared project git tree). Pass "project" to share. Dedup is WITHIN scope: the same URI in two scopes yields two entities. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | Bare ULID of the external_ref, derived deterministically from (scope, uri). | |
| uri | Yes | The canonical URI, echoed back. | |
| name | Yes | AIP resource name of the external_ref; pass to relate(localEntity, has_primary_source, name) or get(name). | |
| scope | Yes | The resolved scope the external_ref lives in. | |
| created | Yes | true if a new external_ref was minted, false if an existing one was returned (mint-or-return). |