Skip to main content
Glama

validate_collection_schema

Read-only

Checks a Directus collection for schema issues—missing primary keys, broken relations, type mismatches, or constraint violations—and reports findings without making repairs.

Instructions

Checks one collection for schema problems and returns the findings: missing primary key, one-sided or broken relations, a database type that disagrees with its interface, constraints the stored data violates. Read-only, and it reports rather than repairs. Use it after create_collection or apply_schema, or when writes fail for no obvious reason; use diagnose_collection_access when permissions rather than schema are the suspicion. strict: true also reports conventions and warnings instead of errors alone.

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

Input Schema

NameRequiredDescriptionDefault
strictNoEnable strict validation
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 already declare readOnlyHint=true, and the description reinforces rather than contradicts that with 'Read-only, and it reports rather than repairs', which adds the useful constraint that no remediation occurs. It also discloses what the strict flag changes behaviorally (warnings and conventions included, not just errors). No return format or volume expectations are given, though the finding categories serve as an informal result shape.

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?

Front-loaded with the action and its outputs, then usage routing, then the strict flag caveat. Every clause carries information: finding types, read-only posture, trigger conditions, sibling distinction, and flag semantics. No filler sentences.

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 read-only inspection tool with no output schema, the definition covers what it examines, what it returns in broad terms, that it mutates nothing, when to invoke it, and the fallback alternative. An agent has everything needed to call it correctly and interpret the result class.

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 the baseline is 3, but the description goes beyond the schema's bare 'Enable strict validation' by explaining that strict adds conventions and warnings alongside errors — genuine semantic value. The collection parameter is only implied ('one collection'), which is fine given the schema documents it.

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?

A specific verb plus resource — 'Checks one collection for schema problems and returns the findings' — followed by an enumeration of the actual finding classes (missing primary key, one-sided/broken relations, type/interface mismatch, data-violating constraints). The final clause distinguishes it from diagnose_collection_access, so an agent can separate the two without opening either schema.

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?

Explicitly states when to call it: after create_collection or apply_schema, or when writes fail for no obvious reason. It also names the alternative — diagnose_collection_access — and the condition that selects it (permission suspicion rather than schema). Nothing is left to inference.

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