Count documents
countCount documents matching a query in an Elasticsearch index without transferring results. Get the exact number quickly, saving resources when only the total matters.
Instructions
Count the documents matching a query, without transferring any. Cheaper than search when only the number matters.
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": {
"index": "<index>"
},
"name": "count"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | Index to count in | |
| query | No | Query DSL. Omit to count every document. |