Skip to main content
skill CX Codex

surrealql-functions — Claude Code skill: SurrealDB built-in functions

Keeps your agent on version-current SurrealQL function signatures instead of whatever the model remembers.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add surrealdb/agent-skills --skill surrealql-functions -a claude-code
Open on GitHub

What 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 .surql files
  • 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-code

2Manually: put the files in place

~/.claude/skills/surrealql-functions/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/surrealql-functions/

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

Similar skills

All skills for Data and databases →

From the same set5

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor