Skip to main content
Glama

surreal-mcp

query

Execute raw SurrealQL queries to perform complex database operations including SELECT statements with joins, schema definitions, transactions, and graph traversals directly on SurrealDB.

Instructions

Execute a raw SurrealQL query against the connected SurrealDB database.

This tool allows you to run any valid SurrealQL query directly. Use this for complex queries that don't fit the other tool patterns, such as:

  • Complex SELECT queries with JOINs, GROUP BY, or aggregations

  • Custom DEFINE statements for schemas

  • Transaction blocks with BEGIN/COMMIT

  • Graph traversal queries

Args: query_string: The complete SurrealQL query to execute. Examples: - "SELECT * FROM user WHERE age > 18" - "SELECT *, ->purchase->product FROM user:john" - "BEGIN; CREATE user:alice SET name = 'Alice'; CREATE user:bob SET name = 'Bob'; COMMIT;"

Returns: A dictionary containing: - success: Boolean indicating if the query executed successfully - data: The query results (format depends on the query) - error: Error message if the query failed (only present on failure)

Example: >>> await query("SELECT name, age FROM user WHERE active = true ORDER BY created DESC LIMIT 10") {"success": true, "data": [{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]}

Input Schema

NameRequiredDescriptionDefault
query_stringYes

Input Schema (JSON Schema)

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