surrealql-functions — Claude Code skill: SurrealDB built-in functions
Keeps your agent on version-current SurrealQL function signatures instead of whatever the model remembers.
npx skills add surrealdb/agent-skills --skill surrealql-functions -a claude-codeWhat surrealql-functions does
SurrealDB ships hundreds of built-in functions grouped into namespaces such as string::, array::, math:: and type::. Names and signatures shift between releases, so this skill pulls them from SurrealQL tooling rather than model memory. Under the hood it uses the surrealql-language-server and the surrealql-tree-sitter grammar that server parses with.
Install the language server from crates.io: cargo install surrealql-language-server drops the binary into ~/.cargo/bin. Confirm it is on your PATH with surrealql-language-server --help. A source build is only for development or tracking unreleased changes, and it expects the tree-sitter grammar checked out as a sibling directory. Browser and editor embedding use a wasm-bindgen package built by bash scripts/build-wasm.sh, which outputs to pkg/.
In your editor, point the LSP client at the surrealql-language-server binary for *.surql files. Type a namespace prefix like string::, trigger completion, and you get that namespace's functions for the installed version; hover and signature help show argument types. That is what keeps renamed or dropped functions out of your queries. The namespace catalog in references/catalog.md links each group to its docs, so you are not hunting through the docs site by hand.
What it helps with
- look up the exact signature of a SurrealQL built-in
- confirm a function exists in the installed SurrealDB version
- get completions and type hints inside
.surqlfiles - find the right function across
string::,array::,math::namespaces - avoid calling a function that was renamed in a newer release
Example prompts for the agent
- list every function in the
string::namespace for my SurrealDB version - what is the signature of this function and what arguments does it take
- check that the
type::function in my query exists in the installed version
How to install surrealql-functions
1Skills CLI (Vercel)
npx skills add surrealdb/agent-skills --skill surrealql-functions -a claude-code2Manually: put the files in place
~/.claude/skills/surrealql-functions/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/surrealql-functions/
1Skills CLI (Vercel)
npx skills add surrealdb/agent-skills --skill surrealql-functions -a codex2Manually: put the files in place
.agents/skills/surrealql-functions/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add surrealdb/agent-skills --skill surrealql-functions -a cursor2Manually: put the files in place
.cursor/skills/surrealql-functions/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install surrealdb/agent-skills surrealql-functions2Manually: put the files in place
.github/skills/surrealql-functions/SKILL.md1Skills CLI (Vercel)
npx skills add surrealdb/agent-skills --skill surrealql-functions -a gemini-cli2Platform CLI
gemini skills install https://github.com/surrealdb/agent-skills --path skills/surrealql-functionsManually: put the files in place
.devin/skills/surrealql-functions/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add surrealdb/agent-skills --skill surrealql-functions -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about surrealql-functions
How do I install surrealql-functions in Claude?
Run npx skills add surrealdb/agent-skills --skill surrealql-functions -a claude-code. The skill lands at ~/.claude/skills/surrealql-functions/SKILL.md.
What does surrealql-functions do?
It feeds your agent accurate built-in function signatures from the SurrealQL language server and tree-sitter grammar. You also get completions, hover types and argument shapes while editing .surql files.
What do I need before using it?
The language server itself: cargo install surrealql-language-server. The published crate bundles the grammar, so no separate tree-sitter checkout is required.
Source text
SKILL.md · MIT
--- name: surrealql-functions description: "Discover and use SurrealDB's built-in SurrealQL functions with accurate, version-current signatures by running the SurrealQL language server (LSP) and tree-sitter grammar, with a namespace catalog linking every function group to its docs. Use when looking up which built-in function to use, its exact signature/arguments, getting editor completions/hover/signature-help for .surql files, or confirming a function exists in the installed SurrealDB version. Triggers: SurrealQL function, built-in function, function signature, string::, array::, math::, type::, LSP, language server, completions, surrealql-language-server." metadata: author: surrealdb version: "0.1.0" --- # SurrealQL Functions SurrealDB ships hundreds of built-in functions grouped into namespaces (`string::`, `array::`, `math::`, `type::`, …). Function names and signatures change between releases, so the authoritative, **version-current** source is the SurrealQL tooling rather than memory: - [surrealql-language-server](https://github.com/surrealdb/surrealql-language-server) (LSP) — completions for built-in functions, hover with type info and function signatures, and signature help. - [surrealql-tree-sitter](https://github.com/surrealdb/surrealql-tree-sitter) — the grammar the LSP parses with (targets SurrealDB v3+). For mapping any function to authoritative documentation, see [references/catalog.md](references/catalog.md). ## When to use this skill - Looking up which built-in function does what, or its exact arguments - Getting live completions, hover, and signature help for `.surql` files - Confirming a function exists / has the expected signature in the installed SurrealDB version (avoids emitting renamed or removed functions) ## Setup Install the language server from crates.io — the published crate bundles the grammar, so no separate tree-sitter checkout is needed: ```bash cargo install surrealql-language-server # -> installs the `surrealql-language-server` binary on your PATH (~/.cargo/bin) ``` Verify it is on your PATH: ```bash surrealql-language-server --help ``` ### Build from source (optional) Only needed for development or to track unreleased changes. The source build requires the [tree-sitter grammar](https://github.com/surrealdb/surrealql-tree-sitter) checked out as a **sibling** directory: ```bash git clone https://github.com/surrealdb/surrealql-language-server.git cd surrealql-language-server bash scripts/setup-grammar.sh # clones/updates the grammar # ...or: export TREE_SITTER_SURREALQL_DIR=/abs/path/to/surrealql-tree-sitter cargo build --release # -> target/release/surrealql-language-server ``` For browser/editor embedding, build the wasm-bindgen npm package instead with `bash scripts/build-wasm.sh` (outputs to `pkg/`). ## Editor integration Point your editor's LSP client at the `surrealql-language-server` binary for the `.surql` / `surrealql` language. Generic stdio LSP configuration: - **Command:** `surrealql-language-server` (or the absolute path from a source build) - **File types:** `*.surql` The server then provides, against the installed grammar version: - **Completions** — built-in function names per namespace, field names, `record<table>` types, and keywords - **Hover** — type info, permission posture, and function signatures - **Signature help** — argument shapes while typing a call ## Using it to discover functions - Open or create a `.surql` buffer connected to the LSP. - Type a namespace prefix (e.g. `string::`) and trigger completion to enumerate that namespace's built-in functions for the installed version. - Hover a function call, or invoke signature help inside the parentheses, to see its exact signature and argument types. Because completions and signatures come from the installed grammar, they reflect the current SurrealDB version — preventing stale or renamed functions from older releases. To read full documentation and examples for any namespace, follow the links in [references/catalog.md](references/catalog.md).
© surrealdb · MIT · surrealdb/agent-skills