get_schema
Analyze sample documents to infer MongoDB collection schema. Use to understand structure before querying, specifying database, collection, and sample size.
Instructions
Infer schema from a collection by analyzing sample documents.
Best Practice: Use this before querying to understand collection structure.
Example: use_mcp_tool with server_name: "mongodb", tool_name: "get_schema", arguments: { "collection": "users", "sampleSize": 100 }
Input Schema
Name | Required | Description | Default |
---|---|---|---|
collection | Yes | Collection name | |
database | No | Database name (optional if default database is configured) | |
sampleSize | No | Number of documents to sample (default: 100) |
Input Schema (JSON Schema)
{
"properties": {
"collection": {
"description": "Collection name",
"type": "string"
},
"database": {
"description": "Database name (optional if default database is configured)",
"type": "string"
},
"sampleSize": {
"description": "Number of documents to sample (default: 100)",
"maximum": 1000,
"minimum": 1,
"type": "number"
}
},
"required": [
"collection"
],
"type": "object"
}