create_document
Add a new document to a specified collection in Typesense, ensuring it includes required fields like 'id' unless using auto-schema. Simplify document creation for structured data storage and retrieval.
Instructions
Creates a single new 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 create (must include an 'id' field unless auto-schema).
Returns:
dict | str: The created document dictionary or an error message string.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
collection_name | Yes | ||
document | Yes |
Input Schema (JSON Schema)
{
"properties": {
"collection_name": {
"title": "Collection Name",
"type": "string"
},
"document": {
"additionalProperties": true,
"title": "Document",
"type": "object"
}
},
"required": [
"collection_name",
"document"
],
"title": "create_documentArguments",
"type": "object"
}