truncate_collection
Delete all documents in a collection while preserving its schema. This process retrieves the schema, deletes the collection, and recreates it with the same structure, ensuring data is cleared without altering the schema design.
Instructions
Truncates a collection by deleting all documents but keeping the schema.
Achieved by retrieving schema, deleting collection, and recreating it.
Args:
ctx (Context): The MCP context.
collection_name (str): The name of the collection to truncate.
Returns:
str: A success or error message string.
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_name": "<collection_name>"
},
"name": "truncate_collection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection_name | Yes |