Skip to main content
Glama

surreal-mcp

insert

Insert multiple records into a database table in a single operation. This bulk insert tool creates many records at once with auto-generated IDs, timestamps, and schema validation for efficient data management.

Instructions

Insert multiple records into a table in a single operation.

This tool is optimized for bulk inserts when you need to create many records at once. It's more efficient than calling 'create' multiple times. Each record will get:

  • An auto-generated unique ID

  • Automatic created/updated timestamps

  • Schema validation (if defined)

Args: table: The name of the table to insert records into (e.g., "user", "product") data: Array of dictionaries, each representing a record to insert. Example: [ {"name": "Alice", "email": "alice@example.com"}, {"name": "Bob", "email": "bob@example.com"}, {"name": "Charlie", "email": "charlie@example.com"} ]

Returns: A dictionary containing: - success: Boolean indicating if insertion was successful - data: Array of all inserted records with their generated IDs - count: Number of records successfully inserted - error: Error message if insertion failed (only present on failure)

Examples: >>> await insert("user", [ ... {"name": "Alice", "role": "admin"}, ... {"name": "Bob", "role": "user"} ... ]) { "success": true, "data": [ {"id": "user:ulid1", "name": "Alice", "role": "admin", "created": "..."}, {"id": "user:ulid2", "name": "Bob", "role": "user", "created": "..."} ], "count": 2 }

Note: For single record creation, use the 'create' tool instead.

Input Schema

NameRequiredDescriptionDefault
dataYes
tableYes

Input Schema (JSON Schema)

{ "properties": { "data": { "items": { "additionalProperties": true, "type": "object" }, "title": "Data", "type": "array" }, "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