Skip to main content
Glama

retrieve_entities

Retrieve entities with filtered lists by type, pagination, search, and snapshot filters. Supports lexical/semantic queries, date and status filters, and lightweight responses.

Instructions

Use this when you need filtered entity lists (by type, pagination, and optional published/date filters) or lexical/semantic retrieval via search. Strict mode: search cannot be combined with non-default sorting or published filters. Set include_snapshots=false for lightweight responses that omit snapshot/provenance/raw_fragments. Use snapshot_filters to filter by snapshot field values server-side (e.g. { "status": { "op": "eq", "value": "active" } } for active entities). Compatibility aliases search_query and query are accepted but search is canonical.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_typeNoOptional single entity type filter (for example: post, task, contact). Combined as a union with `entity_types` when both are supplied.
entity_typesNoOptional multi-type filter. When non-empty, results are restricted to entities whose type is in this list (IN filter), OR-combined with `entity_type`. An empty array is treated as no filter.
searchNoCanonical free-text query for lexical/semantic retrieval. Cannot be combined with published filters or non-default sorting.
search_queryNoCompatibility alias for `search`.
queryNoCompatibility alias for `search`.
similarity_thresholdNoSemantic distance threshold when `search` is used. Lower is stricter (typical 1.0-1.05).
limitNoMaximum number of entities to return (default 100).
offsetNoPagination offset (default 0).
sort_byNoSort field. Non-default values cannot be combined with `search`. Predefined values: `entity_id`, `canonical_name`, `observation_count`, `last_observation_at`, `submitted_at` (orders by `snapshot.created_at`). In addition, `snapshot.<field>` is supported for any snapshot field (e.g. `snapshot.period_end` for time-series entity types such as `usage_digest`). The field value is sorted lexicographically as a string, so ISO-8601 date strings must use a consistent format so that lexicographic order matches temporal order.
sort_orderNoSort direction. `desc` cannot be combined with `search`.
publishedNoFilter by snapshot.published. Cannot be combined with `search`.
published_afterNoInclusive lower bound for snapshot.published_date (ISO date/datetime). Cannot be combined with `search`.
published_beforeNoInclusive upper bound for snapshot.published_date (ISO date/datetime). Cannot be combined with `search`.
include_snapshotsNoWhen false, omit snapshot/provenance/raw_fragments payloads for lightweight responses.
include_mergedNoWhether to include merged entities (default false).
user_idNoOptional explicit user ID (normally inferred from auth context).
updated_sinceNoISO 8601 timestamp. Return only entities whose updated_at is greater than or equal to this value.
created_sinceNoISO 8601 timestamp. Return only entities whose created_at is greater than or equal to this value.
exclude_bookkeepingNoWhen true, omit chat bookkeeping types (`conversation`, `conversation_message`, etc.) from results. Default false. Has no effect when `entity_type` already filters to a bookkeeping type.
snapshot_filtersNoFilter entities by snapshot field values. Each key is a snake_case snapshot field name (e.g. `status`, `priority`); the value specifies operator and comparison value. Filters are applied server-side via `snapshot->>{field}` JSONB extraction, so only entities whose snapshot contains a matching value are returned. Example: `{ "status": { "op": "eq", "value": "active" } }` returns only entities with `snapshot.status === "active"`. Supported ops: `eq`, `in`, `gt`, `lt`, `gte`, `lte`, `contains`.
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses key behaviors such as search constraints, lightweight response option via include_snapshots, and snapshot_filters server-side filtering. However, it does not mention authentication context or rate limits, though these may be inferred. Overall, it adds significant behavioral context beyond the schema.

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 description is a single, dense paragraph that front-loads the purpose. While concise, it could be improved by breaking constraints into bullet points for readability. Every sentence adds value, but the structure could be more scannable.

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?

Given the tool's complexity (20 parameters, nested objects), the description covers main filtering modes, search constraints, and snapshot_filters. However, it omits default behavior when no arguments are provided (e.g., returns all entities with default limit) and does not explain return format (no output schema). It is fairly complete but has minor gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds substantial value: it explains the incompatibility of search with certain filters, provides example usage for snapshot_filters, and clarifies compatibility aliases. This enhances understanding beyond the schema's parameter descriptions, justifying a top score.

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?

The description clearly states it retrieves filtered entity lists or performs lexical/semantic retrieval, using specific verbs and resource. However, it does not explicitly differentiate from sibling tools like retrieve_entity_by_identifier, which also retrieve entities. The differentiation is implicit via 'filtered lists' vs. single entity retrieval, but could be more explicit.

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?

The description provides explicit when-to-use guidance ('Use this when you need filtered entity lists') and includes important constraints ('search cannot be combined with non-default sorting or published filters'). It also mentions compatibility aliases and gives example usage for snapshot_filters, effectively guiding the agent on proper invocation.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/markmhendrickson/neotoma'

If you have feedback or need assistance with the MCP directory API, please join our Discord server