Skip to main content
Glama

surreal-mcp

create

Add new records to SurrealDB tables with auto-generated IDs, timestamps, and schema validation. Specify table name and field data to create structured database entries.

Instructions

Create a new record in a SurrealDB table with the specified data.

This tool creates a new record with an auto-generated ID. The system will automatically:

  • Generate a unique ID for the record

  • Add created/updated timestamps

  • Validate the data against any defined schema

Args: table: The name of the table to create the record in (e.g., "user", "product") data: A dictionary containing the field values for the new record. Examples: - {"name": "Alice", "email": "alice@example.com", "age": 30} - {"title": "Laptop", "price": 999.99, "category": "electronics"}

Returns: A dictionary containing: - success: Boolean indicating if creation was successful - data: The created record including its generated ID and timestamps - id: The ID of the newly created record (convenience field) - error: Error message if creation failed (only present on failure)

Examples: >>> await create("user", {"name": "Alice", "email": "alice@example.com"}) { "success": true, "data": {"id": "user:ulid", "name": "Alice", "email": "alice@example.com", "created": "2024-01-01T10:00:00Z"}, "id": "user:ulid" }

Note: If you need to specify a custom ID, use the 'upsert' tool instead.

Input Schema

NameRequiredDescriptionDefault
dataYes
tableYes

Input Schema (JSON Schema)

{ "properties": { "data": { "additionalProperties": true, "title": "Data", "type": "object" }, "table": { "title": "Table", "type": "string" } }, "required": [ "table", "data" ], "type": "object" }

Other Tools from surreal-mcp

Related Tools

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/lfnovo/surreal-mcp'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server