mongo_create_index
Create an index on a MongoDB collection to enhance query performance. Specify required collection and keys, with optional unique constraint or custom name.
Instructions
Create an index on a MongoDB collection. Blocked when readOnly mode is enabled.
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>",
"keys": "<keys>"
},
"name": "mongo_create_index"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | Yes | JSON string index keys specification (e.g. '{"email":1}'). | |
| name | No | Optional custom index name. | |
| unique | No | ||
| database | No | ||
| collection | Yes | ||
| connectionId | No | Id of the mongodb connection to use. Optional when only one mongodb connection is configured. |