Skip to main content
Glama

surreal-mcp

delete

Permanently remove database records by ID, including connected relations and triggering deletion events. This irreversible operation also handles foreign key constraint validation.

Instructions

Delete a specific record from the database by its ID.

This tool permanently removes a record from the database. Use with caution as this operation cannot be undone. The deletion will also:

  • Remove any graph edges (relations) connected to this record

  • Trigger any defined deletion events/hooks

  • Fail if the record is referenced by FOREIGN KEY constraints

Args: thing: The full record ID to delete in format "table:id" (e.g., "user:john", "product:laptop-123")

Returns: A dictionary containing: - success: Boolean indicating if deletion was successful - deleted: The ID of the deleted record - data: The deleted record data (if available) - error: Error message if deletion failed (only present on failure)

Examples: >>> await delete("user:john") {"success": true, "deleted": "user:john", "data": {"id": "user:john", "name": "John Doe"}}

>>> await delete("product:nonexistent") {"success": true, "deleted": "product:nonexistent", "data": null} # No error even if record didn't exist

Note: This operation is irreversible. Consider using soft deletes (status fields) for recoverable deletions.

Input Schema

NameRequiredDescriptionDefault
thingYes

Input Schema (JSON Schema)

{ "properties": { "thing": { "title": "Thing", "type": "string" } }, "required": [ "thing" ], "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