Skip to main content
Glama
mongodb-js

MongoDB MCP Server

Official
by mongodb-js

collection-schema

Read-only

Describe a MongoDB collection's schema by sampling documents to reveal field names and data types for analysis.

Instructions

Describe the schema for a collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseYesDatabase name
collectionYesCollection name
sampleSizeNoNumber of documents to sample for schema inference
connectionIdYesThe connection to run the operation against. Use the id returned by one of the connect tools, or "preconfigured" to use the connection string the server was configured with.
responseBytesLimitNoThe maximum number of bytes to return in the response. This value is capped by the server's configured maximum and cannot be exceeded.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaYes
fieldsCountYes
Behavior2/5

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

The annotations already declare readOnlyHint=true and destructiveHint=false, and the description is consistent with them. However, the description adds no behavioral context such as document sampling, cost implications, or that the schema is inferred rather than authoritative. It essentially restates the tool's name.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single short sentence and is front-loaded, but it is so terse that it borders on under-specification. It is concise in length yet says little beyond the tool's name, making it only minimally valuable.

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?

The input schema is comprehensive and an output schema exists, but the description does not explain when to use this tool or that it infers schema by sampling documents. The sampleSize parameter hints at sampling, but the description itself provides no operational context, so completeness is adequate but lacking.

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?

The input schema provides descriptions for all 5 parameters, including sampleSize and responseBytesLimit, achieving 100% coverage. The description adds no additional parameter semantics beyond what the schema already states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'Describe' with the resource 'schema for a collection', clearly identifying a read-only introspection operation. It is distinguishable from sibling tools like collection-indexes or list-collections, though it stops short of mentioning that the schema is inferred from sampled documents.

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

Usage Guidelines2/5

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

No guidance is given about when to use this tool versus alternatives, nor any exclusions or prerequisites. The description is purely definitional and leaves the agent to infer use cases from the name and parameters.

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/mongodb-js/mongodb-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server