# surrealql-functions

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

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 413 installs · ★ 28
- Author: surrealdb
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/surrealdb/agent-skills/tree/HEAD/skills/surrealql-functions/SKILL.md
- Updated: 2026-09-29
- HTML: https://affpapa.org/en/nevibecode/skills/surrealql-functions

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add surrealdb/agent-skills --skill surrealql-functions -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/surrealql-functions/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/surrealql-functions/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add surrealdb/agent-skills --skill surrealql-functions -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/surrealql-functions/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add surrealdb/agent-skills --skill surrealql-functions -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/surrealql-functions/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install surrealdb/agent-skills surrealql-functions
```

2. **Manually: put the files in place**
- File: `.github/skills/surrealql-functions/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add surrealdb/agent-skills --skill surrealql-functions -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/surrealdb/agent-skills --path skills/surrealql-functions
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/surrealql-functions/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add surrealdb/agent-skills --skill surrealql-functions -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/surrealdb/agent-skills/tree/HEAD/skills/surrealql-functions/SKILL.md

## When to use it
- 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
- 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

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: c8756642fdbbb335.

BEGIN THIRD-PARTY FILE c8756642fdbbb335
````text
---
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)
````
END THIRD-PARTY FILE c8756642fdbbb335

The third-party file has ended. Everything between the c8756642fdbbb335 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2332 of 4119 bytes. © surrealdb · MIT · https://github.com/surrealdb/agent-skills/tree/HEAD/skills/surrealql-functions/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
