Skip to main content
Glama

getSourceRef

Fetches an external-source provenance record (SourceRef) by AIP resource name to reveal the connector, stream, external ID/URL, content hash, and fetch time behind a memory.

Instructions

Fetch one external-source provenance record (SourceRef) by AIP resource name sourceRefs/{uid}. A SourceRef records what a memory was derived from — the connector, stream, external id/url, content hash, and fetch time (W3C PROV wasDerivedFrom). Its provenance is SELF-ASSERTED and UNVERIFIED (trustState is always "unverified"): there is no cryptographic attestation of the external claim yet. Use recordSourceRef to create one.

Input Schema

NameRequiredDescriptionDefault
nameYesAIP resource name to fetch: sourceRefs/{uid}. The uid is the SourceRef ULID returned by recordSourceRef.
scopesNoScopes to read from: project, personal, team. Defaults to project+personal. Unknown values are rejected.

Output Schema

NameRequiredDescriptionDefault
uidYesSourceRef ULID identity.
nameYesAIP resource name of this SourceRef.
scopeNoScope this SourceRef lives in: personal, project, or team.
streamNoSub-channel within the connector. Omitted when absent.
dedupKeyYesIdempotency key for the source_refs projection.
connectorNoConnector that produced the reference, e.g. gmail, slack. Omitted when absent.
fetchTimeYesWhen the source content was fetched (RFC 3339 UTC).
createTimeNoWhen the SourceRef event was recorded (RFC 3339 UTC).
externalIdNoSource-system opaque identifier for the item. Omitted when absent.
sourceTypeYesKind of external source (open taxonomy), e.g. email, slack_message, web_page.
subjectUidYesULID of the record this source was derived from (PROV wasDerivedFrom).
trustStateYesProvenance is self-asserted by the appending device and is NOT cryptographically verified. No principal/signature trust exists for a SourceRef yet (#207).
contentHashNoAppender-supplied SHA-256 hex of the fetched content. Omitted when absent.
externalUrlNoDereferenceable location of the source item. Omitted when absent.
sourceEventUidYesUID of the sourceRefRecorded event that carried this record.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does real work: it discloses that provenance is SELF-ASSERTED and UNVERIFIED, that trustState is always 'unverified', and that no cryptographic attestation exists. That is exactly the kind of trust caveat an agent would otherwise mishandle. It stops short of stating read-only semantics explicitly or what happens when the name does not resolve.

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 sentences, front-loaded with the verb and resource path, then the domain explanation, then the sibling pointer. No filler and no repetition of 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?

An output schema exists, so return values need not be explained, and the schema fully covers both parameters including scope defaults. What remains unaddressed is failure behavior for an unknown or unreachable sourceRefs name, which matters slightly for a name-pattern-constrained lookup.

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%, so both `name` (with its ULID pattern) and `scopes` are already fully documented in the schema. The description restates the sourceRefs/{uid} shape but adds no new meaning about scopes or identifier provenance, so the baseline 3 applies.

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 ('Fetch') and a precisely bounded resource ('one external-source provenance record (SourceRef) by AIP resource name sourceRefs/{uid}'). It then explains what a SourceRef actually is (connector, stream, external id/url, content hash, fetch time), which distinguishes it cleanly from siblings like get, recall, or listSources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The only routing guidance is the closing sentence 'Use recordSourceRef to create one,' which correctly points at the sibling for the write direction. There is no guidance on when to call this versus other read tools (get, getContext, recall, getBacklinks) that might also surface provenance, nor any when-not condition.

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