Skip to main content
Glama

query_items

Retrieve items from a collection with filters, sorting, pagination, and search. Use Directus filter operators to precisely find data.

Instructions

Query items from a collection with advanced filtering, sorting, pagination, and search. Supports Directus filter operators like _eq, _neq, _lt, _lte, _gt, _gte, _in, _nin, _null, _nnull, _contains, _ncontains, _starts_with, _nstarts_with, _ends_with, _nends_with, _between, _nbetween. Example: {collection: "articles", filter: {"status": {"_eq": "published"}, "date_created": {"_gte": "2024-01-01"}}, sort: ["-date_created"], limit: 10}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesCollection name to query
fieldsNoFields to return
filterNoFilter object using Directus filter syntax
searchNoSearch query string
sortNoSort fields (prefix with - for descending)
limitNoMaximum number of items to return
offsetNoNumber of items to skip
pageNoPage number (alternative to offset)
aggregateNoAggregation functions
groupByNoFields to group by
deepNoDeep query for relational data
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the read-only nature (by verb 'query'), lists supported filter operators, and gives an example, but lacks details on default limits, maximum allowed values, or any side effects. It is adequate but not comprehensive.

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 concise with three clear parts: purpose statement, list of operators, and an example. It is front-loaded and each sentence adds value, though it could be slightly more structured with bullet points for the operators.

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 complexity (11 parameters) and no output schema, the description covers the core functionality with an example and operator list. It does not explain pagination behavior or return format, but the schema handles parameter details, so it is reasonably complete for typical use.

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 baseline is 3. The description adds value beyond the schema by enumerating specific filter operators and providing a concrete example that demonstrates parameter usage (filter, sort, limit). This helps the agent understand how to construct queries.

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 clearly states it queries items with advanced filtering, sorting, pagination, and search, distinguishing it from sibling mutation tools (e.g., create_item, update_item) and other read tools like get_item. The verb 'query items' and specific capabilities make the purpose unmistakable.

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 description implies use cases but does not explicitly state when to use this tool versus siblings like get_item or list_collections. It provides no guidance on exclusions or alternatives, leaving the agent to infer from the context.

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/Skeyelab/directus-mcp-server'

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