insert-many
Inserts multiple documents into a MongoDB collection in one call, batching large arrays to respect payload size limits.
Instructions
Insert an array of documents into a MongoDB collection. If the list of documents is above com.mongodb/maxRequestPayloadBytes, consider inserting them in batches.
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": {
"database": "<database>",
"collection": "<collection>",
"documents": "<documents>"
},
"name": "insert-many"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | Yes | Database name | |
| documents | Yes | The array of documents to insert, matching the syntax of the document argument of db.collection.insertMany(). | |
| collection | Yes | Collection name |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | Yes | ||
| collection | Yes | ||
| insertedIds | Yes | ||
| insertedCount | Yes |