collection-schema
Describe a MongoDB collection's schema by sampling documents. Provide database and collection names, adjust sample size for inference, and receive field structure details.
Instructions
Describe the schema for a collection
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": {
"database": "<database>",
"collection": "<collection>"
},
"name": "collection-schema"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | Yes | Database name | |
| collection | Yes | Collection name | |
| sampleSize | No | Number of documents to sample for schema inference | |
| responseBytesLimit | No | The maximum number of bytes to return in the response. This value is capped by the server's configured maxBytesPerQuery and cannot be exceeded. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | Yes | ||
| fieldsCount | Yes |