Skip to main content
Glama

select

Retrieve data from SurrealDB tables by fetching all records or selecting specific records using their ID for display and processing.

Instructions

Select all records from a table or a specific record by ID.

This tool provides a simple way to retrieve data from SurrealDB tables. Use this when you need to:

  • Fetch all records from a table

  • Retrieve a specific record by its ID

  • Get data for display or further processing

Args: table: The name of the table to select from (e.g., "user", "product", "order") id: Optional ID of a specific record to select. Can be: - Just the ID part (e.g., "john") - will be combined with table name - Full record ID (e.g., "user:john") - will be used as-is - None/omitted - selects all records from the table

Returns: A dictionary containing: - success: Boolean indicating if the selection was successful - data: Array of records (even for single record selection) - count: Number of records returned - error: Error message if selection failed (only present on failure)

Examples: >>> await select("user") # Get all users {"success": true, "data": [...], "count": 42}

>>> await select("user", "john") # Get specific user {"success": true, "data": [{"id": "user:john", "name": "John Doe", ...}], "count": 1} >>> await select("product", "product:laptop-123") # Using full ID {"success": true, "data": [{"id": "product:laptop-123", ...}], "count": 1}

Input Schema

NameRequiredDescriptionDefault
idNo
tableYes

Input Schema (JSON Schema)

{ "properties": { "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "table": { "title": "Table", "type": "string" } }, "required": [ "table" ], "type": "object" }

Latest Blog Posts

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