connect
Establish a connection to a MongoDB instance using a connection string. Use this to create a new connection or switch to a different cluster.
Instructions
Connect to a MongoDB instance. The config resource captures if the server is already connected to a MongoDB cluster. If the user has configured a connection string or has previously called the connect tool, a connection is already established and there's no need to call this tool unless the user has explicitly requested to switch to a new MongoDB cluster.
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": {
"connectionString": "<connectionString>"
},
"name": "connect"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connectionString | Yes | MongoDB connection string (in the mongodb:// or mongodb+srv:// format) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connected | Yes |