upsert_document
Insert or update a document in a Typesense collection using its unique ID. Ensures data accuracy and management in MCP-driven search operations.
Instructions
Upserts (creates or updates) a single document in a specific collection.
Args:
ctx (Context): The MCP context.
collection_name (str): The name of the collection.
document (dict): The document data to upsert (must include an 'id' field).
Returns:
dict | str: The upserted document dictionary or an 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>",
"document": "<document>"
},
"name": "upsert_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection_name | Yes | ||
| document | Yes |