select
Retrieve data from SurrealDB tables by selecting all records or specific entries using their ID for display or 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 namespace: Optional SurrealDB namespace override. If not provided, uses SURREAL_NAMESPACE env var. database: Optional SurrealDB database override. If not provided, uses SURREAL_DATABASE env var.
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
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| id | No | ||
| namespace | No | ||
| database | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||