Skip to main content
Glama

getEntityContext

Assemble a token-budgeted markdown dossier for one entity, combining relations, scalar facts, and mentions into one card to replace multiple small reads.

Instructions

Assemble a single token-budgeted markdown dossier for ONE entity, collapsing what otherwise takes five calls (get + relations + neighbors + recall + facts) into one card. The dossier carries a header (name, kind, entities/{uid}, resolution status), Connections (the entity's typed relations as direction-aware predicate fragments), What I know (its scalar facts), Mentioned in (recall hits naming it), and a counts footer. Pass entity as an entities/{uid} resource name, a bare uid, a display name (resolved case-insensitively), or self. Use at (RFC 3339) to time-slice the relations + facts to a past instant; the header is unchanged. The card never exceeds tokenBudget; lower-priority bullets are dropped behind a marker. An unknown entity returns E_NOT_FOUND; an ambiguous display name returns E_VALIDATION naming the candidates. Prefer this over many small reads when you need the full picture of one entity.

Input Schema

NameRequiredDescriptionDefault
atNoValid-time anchor (RFC 3339 UTC): return the Connections and What-I-know rows as they were live at this instant. Defaults to now. Per ADR-0001 the anchor binds the relation + fact sub-queries only; the entity header (identity) is unchanged.
entityYesWhich entity to profile: an entities/{uid} resource name (feed one straight from a recall hit's entities[] / name), a bare uid, a human display name (resolved case-insensitively), or 'self'. An ambiguous name returns E_VALIDATION naming the candidates; an unknown one returns E_NOT_FOUND.
scopesNoScopes to read from: project, personal, team. Defaults to project+personal. Unknown values are rejected.
includeNoOptional section filter. Omit for all three sections; pass a subset (e.g. ["facts"]) to narrow the card. The entity header and footer always render.
tokenBudgetNoToken budget for the dossier (default 4000). The card never exceeds it; the lowest-priority bullets are dropped behind a marker, then a counts footer is appended.

Output Schema

NameRequiredDescriptionDefault
budgetYesThe token budget that was applied.
tokensYesEstimated token count of the dossier (always <= budget).
droppedNoHow many lower-priority bullets were omitted to fit the budget.
markdownYesThe entity dossier as markdown: a header (name · kind · entities/{uid} · resolution), Connections (typed relations as direction-aware predicate fragments), What I know (the entity's scalar facts), Mentioned in (recall hits naming it), and a counts footer '_N relations, M facts · budget X · used Y_'. Load this verbatim instead of issuing get + relations + neighbors + recall + facts separately.
sectionsNoPer-section counts of what made it into the dossier.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description fully carries the behavioral burden. It discloses truncation behavior ('lower-priority bullets are dropped behind a marker'), time-slice semantics ('header is unchanged'), and error contracts ('E_NOT_FOUND' for unknown, 'E_VALIDATION' naming candidates for ambiguous names). It also defines the dossier's structure (header, Connections, What I know, Mentioned in, counts footer).

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?

The purpose is front-loaded and every sentence contributes useful information. The description is dense but appropriately sized for a composite tool with five parameters, though it could be slightly tighter by avoiding restatement of schema details such as entity formats and budget truncation.

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?

Given the tool's complexity, the description covers the critical dimensions: what the dossier contains, how time-slicing behaves, how truncation works, and what errors to expect. An output schema exists, so return-value formatting need not be explained further. The definition is complete enough to call correctly.

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 the schema already documents every parameter in detail, including accepted `entity` formats, `at` time semantics, `scopes` defaults, `include` filtering, and `tokenBudget` truncation. The description largely restates that information rather than adding new parameter-level meaning, so the baseline of 3 is appropriate.

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?

The description opens with a specific verb and resource: 'Assemble a single token-budgeted markdown dossier for ONE entity.' It immediately distinguishes itself from siblings by naming the five calls it collapses (get + relations + neighbors + recall + facts) and explicitly says to prefer it over 'many small reads' for a full picture. An agent can tell exactly what this tool does and that it is a composite read.

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

Usage Guidelines5/5

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

Usage is explicit: use it when you need the full picture of one entity instead of many small reads. It also names the alternative pattern ('many small reads') and explains the section-filtering option via `include`, plus the time-slicing use case via `at`. No major inference is required to choose this tool.

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