Skip to main content
Glama

import_data

Destructive

Import CSV or JSON rows into one Directus collection, or map a flat file across multiple related collections at once, with dry-run and merge options.

Instructions

Import rows from a CSV or JSON file into one collection, or into several related collections at once using a flat multi-collection file. Subject to the Directus IMPORT_MAX_FILE_SIZE limit (50mb by default).

Single-collection: pass collection; the file is a plain array of rows. Batch (Directus 12.2+): omit collection; the file MUST be a JSON array of { "collection": string, "items": object[] } entries, e.g. [{"collection":"authors","items":[{"name":"Ann"}]},{"collection":"articles","items":[{"title":"Hi","author":1}]}]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoBatch import only. 'add' inserts, 'merge' upserts. Default: add.
confirmNoConfirm a destructive import
dry_runNoBatch import only. Report the changes without writing.
filenameNoFilename for the upload; its extension selects the parser (.csv or .json)
file_dataNoBase64-encoded file contents (alternative to file_path)
file_pathNoPath to a local .csv or .json file
collectionNoTarget collection. Omit for a multi-collection batch import, in which case the file must be an array of { collection, items } entries rather than a bare row array.
dangerously_allow_deleteNoBatch import only. Permit deletion of rows absent from the file. Requires confirm.
Behavior3/5

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

Annotations already mark this as destructive (destructiveHint: true), and the description adds useful operational context such as the 50mb file size limit and the exact batch file structure. It does not, however, describe what destruction occurs beyond the schema's `dangerously_allow_delete` and `confirm` parameters, so the added behavioral context is moderate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, followed by compact mode-specific guidance and a helpful batch file example. Every sentence contributes meaningful information with no filler or repetition.

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?

The description covers the two main call patterns, file format expectations, version requirements, and file size limits. Since there is no output schema, explaining the response is not explicitly required, and the provided detail is sufficient for an agent to invoke the tool 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 all parameters. The description reinforces the key `collection` omission rule and gives a concrete batch example, but it does not add substantial new semantics beyond what the parameter descriptions already state.

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: import rows from a CSV or JSON file into a collection or multiple related collections. It clearly distinguishes this tool from item-level siblings like create_item by emphasizing file-based, potentially multi-collection imports.

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?

The description explicitly explains the two usage modes: pass `collection` for single-collection imports, or omit it for batch multi-collection imports. It also provides format requirements and a Directus version constraint, giving clear contextual guidance, though it does not name alternatives like bulk_operations.

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/staminna/mcp-server-claude'

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