Skip to main content
Glama

get_schema_for_collection

Read-only

Retrieve a collection’s schema in a specified Couchbase bucket and scope by running INFER, with an option to include sample values per field.

Instructions

Get the schema for a collection in the specified scope. Returns a dictionary with the collection name and the schema returned by running INFER query on the Couchbase collection.

num_sample_values sets how many example values INFER reports per field. Leave it unset to use the server's own default (5). Pass 0 to omit sample values entirely, keeping only the structure and type information.

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": {
      "bucket_name": "<bucket_name>",
      "scope_name": "<scope_name>",
      "collection_name": "<collection_name>"
    },
    "name": "get_schema_for_collection"
  }
}

Input Schema

NameRequiredDescriptionDefault
scope_nameYes
bucket_nameYes
collection_nameYes
num_sample_valuesNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.1.0
    • addedInput schema / properties / num_sample_values
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  2. Changed6 schema fields changedv0.8.0
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / bucket_name / title
      Removed value: -"Bucket Name"
    • removedInput schema / properties / collection_name / title
      Removed value: -"Collection Name"
    • removedInput schema / properties / scope_name / title
      Removed value: -"Scope Name"
    • removedInput schema / title
      Removed value: -"get_schema_for_collectionArguments"
    • removedOutput schema / title
      Removed value: -"get_schema_for_collectionDictOutput"
  3. Changed2 schema fields changedv1.0.0
    • addedInput schema / properties / bucket_name
      Added value: +{
      +  "title": "Bucket Name",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "scope_name",
      -  "collection_name"
      -]New value: +[
      +  "bucket_name",
      +  "scope_name",
      +  "collection_name"
      +]
  4. First observed

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the description's job is to add context, and it does add some: schema is produced by an INFER query and sample values default to 5 server-side. However, it says nothing about the cost or latency of inference on large collections, permission requirements, or whether the call blocks — meaningful behavioral facts for an inference-backed read that annotations alone do not convey.

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?

The purpose sentence leads, followed by return description and then the optional-parameter nuance; nothing is padded. The middle sentence about the returned dictionary is somewhat redundant given an output schema exists, but it is short and not harmful.

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

Completeness4/5

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

For a four-parameter read-only tool with an output schema, the description covers what the tool does, how the schema is generated, and how the one optional parameter changes the result. The remaining gaps — hierarchical parameter semantics and inference cost — are secondary for correct invocation.

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 0%, so the description must carry the parameter burden. It fully specifies num_sample_values (unset means server default 5, 0 omits samples while keeping structure and type), which is genuinely useful nuance. The three required addressing parameters (bucket_name, scope_name, collection_name) get no explanation of format or expected values beyond their names.

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 states a specific verb and resource (get the inferred schema for a Couchbase collection in a bucket/scope), and goes further to say the schema comes from an INFER query and is returned as a dictionary keyed by collection name. This clearly separates it from sibling tools such as get_document_by_id, get_bucket_config, or list_indexes, which touch the same hierarchy but return different artifacts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the natural read is 'explore a collection's structure before writing queries.' There is no explicit guidance on when to choose this over get_document_by_id or get_bucket_config, and no stated prerequisites. The only explicit conditional advice concerns num_sample_values, not tool selection.

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