Skip to main content
Glama

get_files

Read-only

List and search Directus file library entries with filters, sorting, field selection, and pagination, returning metadata (ID, filename, type, size, storage) rather than binary contents.

Instructions

Lists files in the Directus file library (directus_files) with filtering, sorting, field selection, search and pagination, returning their metadata rather than their binary contents. Use import_data to load rows from a CSV or JSON file, and get_collection_items for files referenced from a content collection. Returns at most 25 files unless limit says otherwise. Each entry carries the file id, filename, type, size and storage location, which is what an asset URL is built from.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
sortNoSort fields
limitNoNumber of files to return (default: 25)
fieldsNoFields to return
filterNoFilter conditions
offsetNoNumber of files to skip
searchNoSearch query

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv12.3.3

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds genuinely useful behavior: metadata only, no binary payload, and a default cap of 25 files unless limit overrides it. However, it does not discuss pagination behavior at the tail end of results or how the 25-cap interacts with offset.

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?

Front-loaded with the core action and scope in the first clause, then alternatives, then return shape. Dense but every sentence carries routing or behavioral information; the final clause on asset URLs is a slight detour but still informative.

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?

No output schema exists, but the description compensates by naming the returned fields (id, filename, type, size, storage location) and the purpose of those fields for asset URLs. Remaining gaps are minor—total count or paging semantics—and the six optional parameters mean no required-input ambiguity.

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 coverage is 100%, so all six parameters are already documented, including the 25 default on limit. The description enumerates the parameter categories (filter, sort, fields, search, pagination) but adds no syntax, format, or filtering/field-name conventions beyond what the schema provides, so 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 and resource ('Lists files in the Directus file library') plus explicit scope: filtering, sorting, field selection, search, pagination, and that metadata is returned rather than binary contents. It also names the two siblings it is not (import_data, get_collection_items), so an agent can route without opening a schema.

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

Usage Guidelines4/5

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

Gives concrete routing to alternatives: import_data for loading rows from CSV/JSON, get_collection_items for files referenced from a content collection. That is clear context for the main confusion cases, though it stops short of stating when this tool should NOT be used (e.g., fetching a single file by id) or any prerequisites.

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