collection-schema
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
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": {
"connectionId": "<connectionId>",
"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 | |
| connectionId | Yes | The 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. | |
| responseBytesLimit | No | The 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
| Name | Required | Description | Default |
|---|---|---|---|
| schema | Yes | ||
| fieldsCount | Yes |