Count Documents
count_documentsCount documents in a MongoDB collection matching a specified filter, returning the total number of records that meet the query criteria.
Instructions
Count documents in a MongoDB collection that match a filter
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": {
"collection": "<collection>"
},
"name": "count_documents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Query filter as MongoDB Extended JSON, e.g. {"status": "active", "_id": {"$oid": "..."}} | |
| database | No | Optional database to read from for this call only, without changing the active connection | |
| collection | Yes | Collection name |