count
Determine the number of documents in an OpenSearch index or pattern, optionally filtered by a query to narrow the count to specific records.
Instructions
Count documents in an index, optionally filtered by a query.
Args: index: Index name or pattern (e.g. 'logs-*'). query_body: Optional JSON string with a query filter (e.g. '{"query": {"match": {"level": "ERROR"}}}').
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 | ||
| query_body | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |