Skip to main content
Glama

create_item

Insert a single row into a Directus collection and return the created item with its generated primary key. Validation errors abort the write, so nothing is saved.

Instructions

Inserts one item (row) into a collection and returns it, including the generated primary key. Use bulk_operations for many rows in one call, import_data for a CSV or JSON file, update_item to change a row that exists. Directus validates the payload, so a missing required field or a failed validation rule comes back as a tool error and nothing is written. Fields the token may not write are rejected rather than silently dropped. The payload may include relational fields, which Directus resolves against the related collection.

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>",
      "data": "<data>"
    },
    "name": "create_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYesItem data
collectionYesCollection name

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv12.3.3

TDQS

A4.7/5.0
Behavior4/5

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

Annotations cover the safety profile (readOnlyHint=false, destructiveHint=false, openWorldHint=true), and the description adds genuinely new behavior: validation failures abort the write ('nothing is written'), unauthorized fields are rejected rather than silently dropped, and relational fields are resolved server-side. It stops short of stating idempotency, rate limits, or what the error payload looks like, but the added context is well above the annotation baseline.

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?

Four sentences, none wasted: capability and return value first, routing to alternatives second, then failure and permission semantics. Front-loaded and scannable with no repetition of the annotations or schema.

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?

For a two-parameter insert with no output schema, the description covers the return value (the created item with generated primary key), failure behavior, permission filtering, and nested/relational payload handling. Nothing an agent needs in order to call it correctly is missing.

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% with only two terse parameters ('Collection name', 'Item data'), and the description meaningfully enriches both: the collection is a Directus collection validated against its schema, and data may contain relational fields that Directus resolves against the related collection. That is real added meaning beyond the schema, though it does not spell out field-level format expectations.

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 — 'Inserts one item (row) into a collection' — plus the return contract ('returns it, including the generated primary key'). It explicitly positions itself against named siblings (bulk_operations, import_data, update_item), so an agent can select it without opening other schemas.

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?

Each alternative is named with the condition that selects it: bulk_operations for many rows, import_data for a CSV or JSON file, update_item for changing an existing row. This leaves no ambiguity about when this single-row insert is the right choice.

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