index_multiple_documents
Index multiple documents in a Typesense collection by specifying an action (create, upsert, or update). Processes documents in a batch and returns results for each, including success or error details.
Instructions
Indexes (creates, upserts, or updates) multiple documents in a batch.
Args:
ctx (Context): The MCP context.
collection_name (str): The name of the collection.
documents (list[dict]): A list of document dictionaries to index.
action (str): The import action ('create', 'upsert', 'update'). Defaults to 'upsert'.
Returns:
list[dict] | str: A list of result dictionaries (one per document) or an error message string.
Each result dict typically looks like {'success': true/false, 'error': '...', 'document': {...}}.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
action | No | upsert | |
collection_name | Yes | ||
documents | Yes |