Skip to main content
Glama

create_relation

Create many-to-one, one-to-many, or many-to-many relations between Directus collections by providing the collection, field, and related collection.

Instructions

Create a relation between collections (M2O, O2M, or M2M). For M2O: specify collection, field, and related_collection. For O2M: also include meta.one_field. Example M2O: {collection: "articles", field: "author", related_collection: "users"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesMany collection (the collection with the foreign key)
fieldYesField name in the many collection
related_collectionNoOne collection (the related collection)
metaNoRelation metadata
schemaNoDatabase relation configuration
Behavior3/5

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

With no annotations, the description carries full burden. It explains behavior for M2O and O2M, but omits M2M details and does not mention side effects, prerequisites, or the nature of the operation (non-destructive? requires permissions?).

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 short and front-loaded, with two sentences and an example. Every part adds value, no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Lacks output schema and does not explain return values. Missing details on M2M parameters and optional fields (meta, schema). Adequate but could be more complete for a complex operation.

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 descriptions for each parameter. The description adds value by explaining how to structure parameters for different relation types and gives an example, enhancing understanding beyond the schema.

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 creates a relation between collections, specifies the three types (M2O, O2M, M2M), and provides a concrete example for M2O. This distinguishes it from sibling tools like create_field or create_collection.

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 implies usage when creating a relation, but does not explicitly compare to alternatives or state when not to use it. The example helps clarify for M2O, but lacks guidance for M2M.

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