Skip to main content
Glama

get_collection_schema

Read-only

Retrieve a collection's field-level schema to see field names, types, constraints, defaults, and relations before creating or updating items.

Instructions

Returns the field-level schema of one collection: field names, database types, interfaces, required and unique constraints, defaults and relation metadata. Use it before create_item or update_item to learn which fields exist and which are mandatory; use list_collections to find the collection name first, analyze_collection_schema when relationship mapping and constraint checks are also wanted. Read-only. Fails when the collection does not exist or the token cannot read it, and diagnose_collection_access tells those two apart.

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": "get_collection_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
collectionYesCollection name

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv12.3.3

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, and the description reinforces this while adding genuinely new behavior: the two distinct failure modes (collection does not exist vs. token cannot read it) and a pointer to diagnose_collection_access to disambiguate them. It does not discuss caching or response volume, keeping it just short of exhaustive.

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?

Content is front-loaded with the return payload before usage guidance, and every clause carries actionable information. The standalone 'Read-only.' sentence is largely redundant with readOnlyHint=true, a small but real waste in an otherwise dense passage.

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?

There is no output schema, so the description carries the return-value burden and does so by enumerating the returned metadata categories. Combined with the failure-mode disclosure and sibling routing, an agent has everything needed to call this correctly on a one-parameter read tool.

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?

With a single parameter at 100% schema coverage, the schema already carries the baseline; the description still adds meaning by implying where the collection name comes from (list_collections) and by tying the identifier to authorization failures ('the token cannot read it'). That is more than restating 'Collection name'.

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 names a specific verb and resource ('Returns the field-level schema of one collection') and then enumerates exactly what the payload contains: field names, database types, interfaces, required/unique constraints, defaults, and relation metadata. It also explicitly distinguishes itself from the close sibling analyze_collection_schema, so an agent can choose 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?

It states a concrete when-to-use rule ('Use it before create_item or update_item to learn which fields exist and which are mandatory') and names alternatives with their selecting conditions: list_collections to resolve the collection name first, analyze_collection_schema when relationship mapping and constraint checks are also wanted, and diagnose_collection_access when the call fails. This is explicit when/when-not/alternative guidance.

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