Skip to main content
Glama

Define collection schema

define_collection_schema
Idempotent

Define (or clear, with schema=null) a JSON Schema on a collection in a site's data store. A schema validates every appended record server-side, turning the collection into a typed backend. Defining a schema requires Pro. Scoped to a site you can edit.

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": {
      "site_id": "<site_id>",
      "collection": "<collection>",
      "schema": "<schema>"
    },
    "name": "define_collection_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
schemaYesA JSON Schema object to enforce, or null to make the collection schemaless
site_idYesThe site that owns the collection
collectionYesThe collection name
workspace_idNoOptional: the workspace to act in, from list_workspaces (the connection reaches the person's personal space and every workspace they are a member of). Required on a write when the connection reaches more than one workspace. Omit to act in the personal space (for an older single-workspace connection, the one workspace it was authorized for).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / workspace_id / description
      Previous value: -"Optional: the workspace (the personal space or a Pro workspace) to act in, from list_workspaces. Omit to act in the token owner's own account."New value: +"Optional: the workspace to act in, from list_workspaces (the connection reaches the person's personal space and every workspace they are a member of). Required on a write when the connection reaches more than one workspace. Omit to act in the personal space (for an older single-workspace connection, the one workspace it was authorized for)."
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=true and destructiveHint=false; the description adds real value beyond them by disclosing the server-side enforcement effect, the Pro entitlement requirement, and the write-authorization scope. The schema=null path is a form of removal that the description surfaces even though destructiveHint is false, which is useful (data itself is not deleted, so this is not a contradiction). It does not say what happens to already-stored records that fail a newly defined schema.

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?

Four short sentences, front-loaded with the core action and its inverse before the rationale and constraints. The one wasted phrase is 'turning the collection into a typed backend', which restates the preceding clause, and the schema=null detail duplicates the schema field.

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 single-purpose write tool with no output schema and fully documented parameters, the description covers purpose, effect, entitlement, and authorization scope. The main residual gap is retroactive behavior on existing records, which is an edge case rather than something needed 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 all four parameters, including workspace_id and its multi-workspace rules, are already fully documented in the schema. The only parameter fact the description mentions (schema=null makes the collection schemaless) is a verbatim restatement of the schema's own text, and workspace_id is not discussed at all. Baseline 3 is appropriate.

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 ('Define ... a JSON Schema on a collection') and immediately covers the inverse operation ('or clear, with schema=null'). An agent can tell this apart from delete_collection or list_site_collections without opening a schema, since it is explicitly about attaching validation, not about the collection's existence or enumeration.

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?

Gives the reason to reach for it ('A schema validates every appended record server-side, turning the collection into a typed backend') and two hard preconditions: Pro plan and edit scope on the site. It stops short of naming alternatives (e.g., where to get a valid collection name) or stating when not to define a schema, so it is clear context rather than full routing guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.