Raw SurrealQL Query
Execute a custom SurrealQL query using the raw_query MCP tool.
Query: $ARGUMENTS
Important
functionis a reserved word — always use backticks: `function`- String search:
string::contains(string::lowercase(name), "pattern")
Common Queries
-- All functions
SELECT name, file_path FROM `function` ORDER BY name
-- Largest functions by line count
SELECT name, file_path, (end_line - start_line) AS lines FROM `function` ORDER BY lines DESC LIMIT 10
-- All structs
SELECT name, file_path FROM class WHERE kind = "Struct"
-- Functions in a specific file
SELECT name, start_line FROM `function` WHERE file_path CONTAINS "main"
-- Call graph for a function
SELECT ->calls->`function`.name AS calls FROM `function` WHERE name = "main"
-- Most imported modules
SELECT name, count() AS usage FROM import_decl GROUP BY name ORDER BY usage DESC LIMIT 10
-- Files with most functions
SELECT file_path, count() AS fn_count FROM `function` GROUP BY file_path ORDER BY fn_count DESC LIMIT 10
Display results as a formatted table. Explain the results briefly.
Full SurrealQL Reference
See references/SURREALQL.md for the complete syntax guide including graph traversal, anti-patterns, and parameterized queries.