Add or update documents
search_add_documentsAdd or replace up to 1,000 documents in an index, all or nothing. Use when loading or syncing the app's records into an index. Before: search_get_index (needs search query access) for the fields. Returns the task: indexed, unchanged and stale counts, and the receipt. Scope: search:write. Reuse the same idempotency_key on retry. Cost: priced at get_pricing; any price is reserved on the prepaid balance before the call. Refused for balance or a limit: follow next_action.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "products",
"documents": [
{
"id": "sku-1",
"brand": "Acme",
"price": 75,
"title": "Leather shoes"
}
],
"idempotency_key": "sync-products-0001"
},
"name": "search_add_documents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Index name. | |
| documents | Yes | The documents. A document with an existing id replaces it. | |
| idempotency_key | Yes | Unique per request. Reuse it on retry. |