Skip to main content
Glama

get_collection_items

Read-only

Read rows from a Directus collection with filtering, sorting, field selection, search, and pagination, including version reads; retrieve content data within token permissions.

Instructions

Reads items (rows) from one collection with Directus filtering, sorting, field selection, full-text search and pagination. This is the read path for content: use get_users, get_files or get_flows for those system collections, and get_collection_schema when the shape rather than the data is wanted. Returns at most 25 items unless limit says otherwise, so paginate with offset over large collections. Results are scoped to what the token may read, so a filter can legitimately return fewer rows than exist. On versioned collections, version reads one draft and version_raw returns the delta instead of the merged item. Since Directus 12.6.1 search also matches related fields through a many-to-many junction.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "collection": "<collection>"
    },
    "name": "get_collection_items"
  }
}

Input Schema

NameRequiredDescriptionDefault
sortNoSort fields
limitNoNumber of items to return (default: 25)
fieldsNoFields to return
filterNoFilter conditions
offsetNoNumber of items to skip
searchNoFull-text search across the collection's searchable fields. Since Directus 12.6.1 a search on a many-to-many junction also matches the related fields, and a numeric search no longer matches hidden ID fields such as the junction row ID.
versionNoContent version to read from a versioned collection. Use 'published' for the published version, or a version key for a draft.
collectionYesCollection name
version_rawNoReturn the raw version delta instead of the item merged with its version

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv12.6.1
    • changedInput schema / properties / search / description
      Previous value: -"Search query"New value: +"Full-text search across the collection's searchable fields. Since Directus 12.6.1 a search on a many-to-many junction also matches the related fields, and a numeric search no longer matches hidden ID fields such as the junction row ID."
  2. First observedv12.3.3

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint; the description adds genuinely non-obvious behavior: a 25-item default cap that necessitates offset pagination, permission-based result scoping that can silently shrink result sets, and the version vs version_raw distinction on versioned collections. The note about Directus 12.6.1 search matching related fields via many-to-many junctions is extra operational context an agent could not infer elsewhere.

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?

Purpose and routing alternatives are front-loaded in the first two sentences, with operational caveats after. The search/version sentence is dense but each clause carries distinct information; only the versioning clause mildly repeats what the schema already says.

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?

Despite nine parameters and no output schema, the description covers the things an agent must know to call this correctly: default result cap, pagination strategy, permission scoping, and versioned-collection reads. Nothing material for a correct invocation is left to inference.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description goes slightly beyond it by explaining how version and version_raw relate to each other (one draft vs the raw delta instead of the merged item) and by reinforcing the limit default that drives pagination. It still doesn't illustrate filter/sort syntax or provide a filter operator example for the nested object, which keeps it out of 5 territory.

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 and resource ('Reads items (rows) from one collection') and enumerates the supported capabilities (filtering, sorting, field selection, search, pagination). It explicitly carves itself apart from get_users/get_files/get_flows and get_collection_schema, so an agent can identify it without opening any schema.

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?

Names concrete alternatives and the condition that selects them: system collections go to get_users/get_files/get_flows, schema shape goes to get_collection_schema. It also gives operational guidance (paginate with offset because of the 25-item default) and warns that filtering can return fewer rows than exist due to token scoping.

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