Docs · Reference · RQL

RQL —
one query instead of thirty tool calls.

RQL (Reflection Query Language) is a pipeline language for querying and safely changing live object graphs. The agent uses it to read and edit an open Unity, Unreal Engine or Godot project through three MCP tools: rql-query, rql-mutate and rql-schema.

View as Markdown

Overview

A query is a source followed by stages: source | stage | stage …. Every stage works on live editor objects, not on a JSON copy of the scene. Only the rows that survive filtering and projection are serialized and sent to the agent.

FactValue
PackageNuGet com.IvanMurzak.Rql (each engine plugin bundles its own RQL runtime); QueryPlan protocol 0.1
Runtimes.NET (reference, with the text parser), TypeScript (parser and runtime), C++ (runs QueryPlans; no text parser)
Used byUnity-MCP, Unreal-MCP and Godot-MCP: the same three tools in each
SafetyRead-only unless the mutation tool is used; all-or-nothing writes; undoable; budgets on every query
Spec and sourcegithub.com/IvanMurzak/RQL: docs/language-reference.md, spec/semantics.md, docs/host-integration.md
  • One precise call replaces many exploratory calls: filter, project, sort, count and walk hierarchies in a single query.
  • Compact table results use far fewer tokens than object-by-object JSON dumps.
  • Errors come back as diagnostics with hints (an unknown member suggests the closest names), so the agent corrects itself.
  • Bulk edits and bulk creation run in one all-or-nothing, undoable call: range(0, 150) | call editor.CreateGameObject(…) builds a grid of 150 objects.

This reference follows the current RQL language. Each engine plugin bundles the RQL runtime it was built with, so recent additions (conditionals, text, vector and trigonometry functions, bulk create, arguments by name, max_targets and the default of 200 targets) need a plugin release whose runtime is newer than 0.2.0; older plugins keep a fixed limit of 20 targets. The rql-query and rql-mutate tool descriptions in your editor list what your version supports.

In the RQL repository's own evaluation (a DeepSeek agent on tasks with hidden answers; method and caveats in its RESULTS.md), RQL tools solved 100% of a fresh 90-task set written after tuning was frozen. A conventional reflection-tool baseline (find / dump object as JSON / set / call) solved 66.7% of the same set and cost 40× more per successful task.

Quick example

Find the three brightest lights in a Unity scene. Read the query left to right: every GameObject → its components → only lights brighter than 2 → brightest first → top 3 → three columns.

objects | get components | where $ is Light and intensity > 2 | sort intensity desc | first 3 | select gameObject.name intensity color

The agent receives:

3 results
gameObject.name|intensity|color
Sun|3.5|(1, 0.96, 0.84, 1)
Torch_A|2.4|(1, 0.6, 0.2, 1)
Torch_B|2.2|(1, 0.6, 0.2, 1)

Halve them, as a preview first (rql-mutate with dry_run: true). The receipt shows every planned write; nothing changes until the call runs without dry_run.

objects | get components | where $ is Light and intensity > 2 | set intensity = intensity / 2

The receipt:

DRY RUN — nothing changed; 3 results
$ref|member|old|new
Light#24816|intensity|3.5|1.75
Light#24822|intensity|2.4|1.2
Light#24830|intensity|2.2|1.1

Scene names, values and ids in these two results are illustrative.

The MCP tools

Unity, Unreal Engine and Godot register the same three tools with the same parameters. Each returns plain text (no structured output). A failed query comes back as a tool error.

ToolParametersWhat it does
rql-queryquery (string, required)Read-only. Runs the query and returns compact rows. A query with set or call fails with permission-denied.
rql-mutatequery (string, required) · dry_run (bool, default false) · max_targets (int, default 200, at most 1000; newer plugin releases)The last stage must be set or call. All-or-nothing and undoable. dry_run: true returns the receipt and changes nothing. max_targets raises the target limit for an intended bulk change; it stays one undo step.
rql-schematype (string, optional)Without a type: the sources, the functions and an overview of the types in the open scene or level. With a type ("Light", "PointLightComponent", "Node3D", "Vector3") or a source name ("editor"): its members (ro = read-only) and callable methods. Unknown types get suggestions.

An MCP client sends standard tools/call requests:

{
  "name": "rql-query",
  "arguments": { "query": "objects | where name contains \"Enemy\" | select $ref name" }
}

{
  "name": "rql-mutate",
  "arguments": { "query": "objects | where name == \"Player\" | set active = false", "dry_run": true }
}

{
  "name": "rql-schema",
  "arguments": { "type": "Light" }
}

The engine CLIs call the same tools from a terminal: unity-mcp-cli, unreal-mcp-cli and godot-cli run-tool rql-query --input '…' (see each engine below).

Syntax basics

The source is a path that starts with a registered source name (objects, actors, nodes …), a ref("Type#id") call, or a host function such as unity.assets("t:Material"). A path may continue from it: scenes[0].roots. A list value becomes the item stream, a map yields its entries, anything else is a single item. An unknown source fails with unknown-source and suggestions.

RuleDetail
Query shapesource | stage | stage …. Whitespace (space, tab, CR, LF) separates tokens and is otherwise ignored, so a query may span lines.
IdentifiersA letter or _, then letters, digits or _. Member lookup tries the exact name first, then a unique case-insensitive match.
HyphensA hyphen directly between two identifier segments, followed by a letter or _, is part of the name: starts-with, group-by, max-depth. a - b and a-1 are subtraction, so put spaces around a minus between two names.
Quoted namesBackticks quote a member name that is reserved or unusual: `null`, `my field`.
DotsAlways member access. ns.fn(x) calls a registered host function, such as unity.find("Player").
CommentsNone. Every character is part of the query.
LimitsAt most 100 levels of expression nesting and 1000 operators. Number literals must be finite. Digits are ASCII only.
One query per callComparisons do not chain (a contains "x" == false is a syntax error; write not (a contains "x")), and a second query on a new line is reported as such.

Pipeline stages

Each stage reads a stream of items and writes a stream of items. Terminal stages (count, sum / min / max / avg, describe, set, call) must be last; otherwise the query fails with invalid-plan. Examples use Unity member names; health and maxHealth stand for fields of a game script.

StageMeaningExample
where <predicate>Keeps the items whose predicate is true. Items where it is false or unknown are dropped.where active and name contains "Enemy"
select [alias=]<path> …Projects each item to a row. A column is named by its alias or by its source text. Commas between columns are optional. Put a computed expression in parentheses. <expr> as <alias> also works. An alias cannot start with $.select $ref name hp=(health / maxHealth)
sort <key> [asc|desc], …Stable sort. null and missing values go last in both directions. Mixed kinds order as number < string < bool < other. A key that fails (a division by zero, a getter that throws) sorts those items last and adds a warning naming the key. Put a computed key in parentheses.sort (health / maxHealth) desc, name
first [N]The first N items (default 1). Stops reading upstream once it has them. limit N is an alias.sort health | first 5
skip NDrops the first N items. Use it with first for paging.skip 50 | first 50
countTerminal. Returns the number of items.where $ is Light | count
get <path>Replaces each item by the value of the path. A list value is flattened into separate items. null and missing values are dropped.get components
recurse [via …] [max-depth=N] [include-self=false]Depth-first, pre-order. Emits each item (depth 0) and then its descendants. With via members, only those members are followed. Without them, every owning object member is followed. Cycle-safe. max-depth defaults to 8. include-self=false drops the start items.recurse children max-depth=3
distinct [<expr>]Keeps the first item for each distinct value (default $). Objects compare by identity, projected rows by their column values, lists by their elements, structs (vectors included) by their members as they print. To list the values, project first.select tag | distinct
group-by <expr>Replaces the stream by rows with members key and count, in order of first appearance. null and missing keys form one null group. Every row also has items, the group's items, for per-group aggregates. Not terminal.group-by tag | select key, count, avg = items.avg(health)
group-by [name=]<expr>, …Several keys, or a named key: one row per combination, one column per key, then count. Group by type with $type. A key member most items lack gets a warning with the counts.group-by $type, big=(mass > 10)
sum | min | max | avg <expr>Terminal aggregate. Skips null and missing values. sum of nothing is 0, the others are null. min / max also order strings.get components | where $ is Rigidbody | sum mass
describeTerminal. Returns the schema of the distinct runtime types of the items: members, kinds and writability.selection | describe
set <path> = <expr>, …Mutation, terminal. Assigns members on every item; values see the item as $, its position as $index and the stream size as $count. Allowed in rql-mutate only.set transform.position.x = $index * 2
call <Method>(<args>)Mutation, terminal. Invokes a method the host allowlists on every item. Allowed in rql-mutate only.call AddComponent("Rigidbody")
call <source>.<Method>(<args>)Mutation, terminal. Runs the method of the one object the source yields, once per stream item, with $ and $index the item's: bulk create from range(…) or a list. Every call counts against the target limit.range(0, 10) | call editor.CreateGameObject("Tile_" + $)
<ns>.<stage> …An extension stage registered by a host or module (namespaced). An unregistered name fails with unknown-stage.(host-defined)

Operators

Comparison

OperatorMeaningExample
== · =Equal. Numbers compare numerically. Strings compare case-sensitively. An enum equals its number or a name that resolves to it: exact, after a Type:: qualifier, ignoring case, or without the entry prefix ("Fill" → HAlign_Fill); editor display names work too. Objects compare by identity. null == null is true. Lists compare by value, in order. Two structs of one type compare member by member; vectors and colors within a small tolerance.tags == ["a", "b"]
!=Not equal. null != x is true for any non-null x.tag != "Untagged"
< <= > >=Order. Works on numbers, strings (ordinal) and enums (underlying value). Anything else gives unknown.health < 20
containsOn strings: case-insensitive substring. On a list: membership using ==.components.$type contains "Rigidbody"
starts-with · ends-withCase-insensitive prefix / suffix test on strings.name starts-with "Enemy_"
matchesCase-insensitive regex. The portable subset is literals, . * + ? ^ $ [] () | and \d \w \s. The .NET runtime limits each match to 50 ms.name matches "^Enemy_\d+$"
in · not in== against each element of a list.tag in ["Enemy", "Boss"]
is null · is not nullNull test. An absent map entry is null; a misspelt member gives unknown, not true.transform.parent is null
is <Type> · is not <Type>true when the runtime type, a base type or an interface has that short name (case-insensitive). The type may also be a string.$ is Light

Logical (three-valued)

Predicates are true, false or unknown. A comparison with a missing member or an error is unknown, and where keeps only true. So where not (health > 5) does not return objects that have no health: test with has(health).

OperatorMeaningExample
and · &&Kleene AND: false and unknown is false.active and health > 0
or · ||Kleene OR: true or unknown is true.tag == "Enemy" or tag == "Boss"
not · !Kleene NOT: not unknown is unknown.not active
cond ? a : bConditional, the same as if(cond, a, b): only the taken branch runs. Lowest precedence, so wrap it in parentheses inside select.select kind=(intensity > 2 ? "bright" : "dim")

Arithmetic

OperatorMeaningExample
+Adds numbers. Concatenates when either side is a string.name + " (copy)"
- * /Subtract, multiply, divide. Division by zero gives a div-by-zero error value.health / maxHealth * 100
%Remainder. Modulo by zero gives div-by-zero.$index % 2 == 0
-xUnary minus. A negated number literal folds into the literal.transform.position.y < -10
vectorsVectors and colors compute component by component: v * n, n * v, v / n, v + w, v - w, v * w, v / w, -v, and a list of as many numbers on either side. v + n is a type-mismatch (add [x, y, z]); quaternions do not compute.transform.localScale * 1.5 · transform.position + [0, 1, 0]
number listsA list of numbers is a vector too: L * n, n * L, L / n, L + M, L - M (same length), -L. L * M is refused: use dot(a, b).[transform.position.x, 0, transform.position.z] * 2

Vectors are computed where the engine marks them: Unity Vector2/3/4 and Color, Unreal Vector, Rotator and colors, Godot Vector2/3/4 and Color. Quaternions, matrices and transforms are not.

Precedence

LevelOperators
0 (lowest)? : conditional (right-associative)
1or ||
2and &&
3not !
4comparison: == = != < <= > >= contains starts-with ends-with matches is in (one per expression, not chained)
5+ -
6* / %
7unary -
8 (highest)postfix: .member, [index], .method(args), (…) grouping

Keywords and aliases

Eight words are reserved. To use one as a member name, quote it in backticks. The others are special only in their position.

WordKindMeaning
and or notreservedLogical operators.
inreservedList membership (x in [a, b], x not in […]).
isreservedNull and type tests (x is null, $ is Light).
null true falsereservedLiterals.
asc desccontextualSort direction, only after a sort key.
ascontextualColumn alias in select (select health as hp).
max-depth include-selfcontextualOptions of recurse (max-depth=4, include-self=false).
stage namescontextualwhere select sort first limit skip count get recurse distinct group-by sum min max avg describe set call are special only right after |.

Accepted alternatives

The parser accepts these forms and canonicalizes them:

You may writeMeans
= (in an expression)==
&& || !and or not
limit Nfirst N
select <expr> as <name>select <name>=(<expr>)
x is null / x is not nullx == null / x != null
x not in L, x is not Tnot (x in L), not (x is T)
cond ? a : bif(cond, a, b)
WHERE, And, NULL, …Keywords and core stage names in any letter case.

Paths and meta members

FormMeaning
a.b.cMember access, chained.
list[0] · list[-1]Index from the start, or from the end. An index out of range is missing.
map["key"] · map.keyKey lookup. A real member of the map type with that name (such as Count) wins for .key. ["key"] is always a key lookup. An absent key reads as null; has(map["key"]) tests whether it exists.
list.memberMaps over the elements, skips missing results and flattens one level: components.$type is the list of component type names.
list.Count · list.LengthThe size of a list or map, in any letter case. .count() is the portable form.
list.method(args)A collection method (see below). Inside its arguments, $ and bare names refer to the element. A name the element lacks is looked up on the enclosing item.
fn(args) · ns.fn(args)A core function, or a host function registered by the engine.
a projected columnAfter select, rows have exactly their columns. A dotted path that equals a column name resolves to it (select owner.name hp | sort owner.name). A single-column row stands for its value.

Meta members

MetaValue
$The current item. Inside a collection method, the current element.
$refA stable reference string Type#id, such as Light#1234. Objects without a stable id get a session handle Type@n.
$typeThe short runtime type name, without namespace or generic arity.
$pathThe navigation path by which the item was reached, e.g. objects[3].children[1].
$indexThe zero-based position of the item in the stream that enters the current stage. In a set value or call argument: the target's position in the stream entering set / call.
$countIn a set value or call argument only: the number of items entering the stage, so $index runs from 0 to $count - 1.
$depthDuring and after recurse: the depth below the start item (0 = start). Missing otherwise.

Functions

Core functions work in every runtime. Numeric functions pass null, missing and error arguments through unchanged; any other non-number gives type-mismatch. List functions never change their argument: assign the result. Engines add namespaced functions (unity.*, unreal.*, godot.*), listed per engine below.

FunctionResultExample
has(path)true if the path exists and every map lookup in it finds its key. The argument is not evaluated beyond the path.where has(intensity)
is-null(x)Same as x is null.where is-null(transform.parent)
len(x)String length, or list / map size. Missing for anything else.where len(name) > 20
lower(s) · upper(s)Invariant case conversion.select lower(name)
abs(n) · floor(n) · ceil(n)Numeric.where abs(transform.position.x) > 100
round(n[, digits])Rounds, optionally to a number of decimal digits.select r=(round(health / maxHealth, 2))
sqrt(n) · pow(base, exp)IEEE math. sqrt of a negative number is NaN.select d=(sqrt(pow(transform.position.x, 2) + pow(transform.position.z, 2)))
min(a, b, …) · max(a, b, …)The smallest / largest of two or more numbers. One argument is an arity error.select m=(max(health, 0))
sin · cos · tan · asin · acos · atan · atan2(y, x)Trigonometry in radians. Results are rounded so the engines agree on the digits: sin(pi()) is 0.set transform.position = [5 * cos(2 * pi() * $index / $count), 0, 5 * sin(2 * pi() * $index / $count)]
pi() · deg(x) · rad(x)π; radians to degrees (deg(atan2(1, 1)) is 45); degrees to radians.select a=(deg(atan2(transform.forward.x, transform.forward.z)))
length(v) · magnitude(v)The length of a vector (a vector struct or a list of numbers). len stays the size of a string or list.where transform.position.length() > 100
normalize(v) · distance(a, b) · dot(a, b) · lerp(a, b, t)Vector functions. distance and dot return numbers; normalize and lerp a vector of the first argument's kind.where distance(transform.position, unity.find("Player").transform.position) < 10
if(cond, a, b)Conditional (also written cond ? a : b). Only the taken branch is evaluated, so it can guard an error.set intensity = (intensity > 5 ? 5 : intensity)
coalesce(a, b, …)The first argument that has a value: not null, missing, unknown or an error (1 to 16 arguments).select p=(coalesce(transform.parent.name, "(root)"))
ref("Type#id", …)Resolves stable references. Several ids, or a list of ids, give a list. A destroyed or unknown object gives stale-ref.ref("GameObject#1234")
append(list, v, …)A new list with the values added at the end.set targets = append(targets, ref("GameObject#1234"))
insert(list, i, v)A new list with v before index i. A negative i counts from the end, -1 appends.set targets = insert(targets, 0, ref("GameObject#1234"))
remove-at(list, i)A new list without the element at i (negative counts from the end).set targets = remove-at(targets, -1)
without(list, v)A new list without the elements equal to v.set targets = without(targets, null)
range(start, end[, step])The numbers from start up to end (excluded). As a query source it streams them, for bulk create.range(0, 100) | call editor.CreateGameObject("Cube_" + $)
replace(s, from, to) · replace-regex(s, pattern, repl)Replace every occurrence (case-insensitive), or every regex match ($1 inserts group 1).set name = name.replace("Pillar_", "Column_")
substring(s, start[, length]) · split(s, sep) · trim(s) · pad(v, width[, fill])Text helpers. Positions clamp to the string; pad(3, 2) is "03".set name = "Tile_" + pad($index, 3)
contains(a, b) · starts-with(a, b) · ends-with(a, b) · matches(a, b)Function forms of the operators.where starts-with(name, "UI_")

Collection methods

Called on a list or map value: list.method(args). Arguments are evaluated per element, with $ as the element.

MethodResultExample
.any([pred])true if some element matches. With no predicate: the collection is not empty.components.any($ is Light)
.all(pred)true if every element matches. An empty collection gives true.children.all(active)
.count([pred])The number of elements, or of matching elements.children.count(active) > 3
.first([pred])The first element, or the first matching one. Missing when there is none.components.first($ is Collider)
.sum([e]) · .avg([e])Sum / average of e over the elements; non-numbers are ignored. Empty: sum gives 0, avg gives null.children.sum(transform.position.y)
.min([e]) · .max([e])Smallest / largest of e; also orders strings. Empty gives null.children.max(transform.position.y)
.keys() · .values()The keys or values of a map.{a: 1, b: 2}.keys()
.contains(x) · .starts-with(x) · .ends-with(x) · .matches(x)Method forms of the operators.name.starts-with("Enemy")
.lower() · .upper() · .len()Method forms of the functions.name.len()
.replace(…) · .substring(…) · .split(…) · .trim() · .pad(…)Method forms of the text functions.name.substring(0, 4)
.length() · .normalize() · .distance(b) · .dot(b) · .lerp(b, t)Method forms of the vector functions.transform.position.distance([0, 0, 0])

Literals

KindSyntaxNotes
Number42 1.5 2e-3 -7ASCII digits. Write 0.5, not .5. A unary minus folds into the literal.
String"Player" 'Player'Escapes: \" \' \\ \n \t \r \uXXXX. Any other escape keeps its backslash, so "a\.b" reaches a regex unchanged.
Booleantrue falseAny letter case.
NullnullAny letter case.
List[1, 2, 3] ["Enemy", "Boss"] []Elements are any expressions.
Object{x: 1, y: 2} {$type: "FastSettings", speed: 2} {}Keys are names, strings or $-names, unique and non-empty. Behaves as a map. On a write it builds the value (see Conversion on writes); as the only call argument it can pass arguments by name.
Engine value text"(0, 1, 0)" "#ff8800"Plain strings that engine type adapters convert on writes and comparisons: vectors, rotations, colors.

Values and types

Every expression evaluates to one of these kinds. missing, null and error stay distinct.

KindMeaning
missingThe path does not exist on this value: no such member or index. An absent map key is not missing: it reads as null.
nullThe member exists and its value is null.
errorEvaluation failed: a getter threw, division by zero, a type mismatch. Carries a code.
bool, number, stringScalars. Numbers compare numerically, whatever the runtime's int / float types.
enumCompares to strings by name (case-insensitive) and to numbers by underlying value.
objectA reference-like runtime object with identity. Has a $ref.
structA value type (e.g. Vector3). No identity. == compares two of one type member by member; vectors and colors also compute component by component.
listAn ordered collection: array, list, set, or any enumerable that is not a string or map.
mapKey → value. Iterating it yields entries with key and value; other members of an entry read from its value.

Conversion on writes

set and call arguments are converted to the target type. A value that does not convert fails with coercion-failed.

Target typeAccepts
IntegerA number with an integral value that fits the type.
EnumIts name as a string (type = "Spot"), qualified ("LightType::Spot"), in any case, or the editor's display name. An ambiguous name fails and lists the candidates.
Nullable or reference typenull.
List or arrayA list literal ([a, b]).
MapAn object literal, entry by entry.
Class or structAn object literal. The value is constructed and the named members are assigned; members not named keep their defaults. $type picks a concrete subtype. Plain data and value-like assets (Godot resources, Unity materials and data ScriptableObjects) are built this way; owned subobjects such as Unreal input triggers are built for the object they are written into.
Scene objectNever built from a literal (game objects, components, actors, nodes): pass an existing one, or create it with an engine call (CreateGameObject, SpawnActor, CreateNode).
Vector, rotation, color …What the engine adapter accepts: "(1, 2, 3)", [1, 2, 3], {x: 1, y: 2, z: 3}; colors also "#rrggbb".
Object referenceref("Type#id"), the engine's find function, or an asset path string (Unity "Assets/…", Unreal "/Game/…", Godot "res://…").

Results

The tools return the compact table format:

PartFormat
Diagnostics (first, optional)error <code>: <message> — hint: <hint> or warning …, one per line
Header1 result, N results, or N of M (truncated; page with skip N | first M, or count); a dry run starts with DRY RUN — nothing changed;
Columnscol|col|…: the select columns, or the receipt columns
RowsOne per line. Objects show as Type#id(Name), vectors and colors as (x, y, z), structs and maps as {k:v,…}, lists as [a,b]. Strings are unquoted unless ambiguous. Numbers show at most 15 significant digits.
Scalarscount and aggregates print the bare value, e.g. 3.
Receiptsset: $ref|member|old|new (new is read back after the write); assignments that kept the value are counted (“N unchanged assignment(s) not listed”), not listed. call: $ref|method|result (a created object's $ref is in result). Long receipts list the first 50 rows with a count of the rest; a call receipt prints a method shared by every row once and drops a $ref equal to the result's.

Without select, every item is one row showing the object itself. Long lists in a cell are cut after 20 items with a …+N marker. Page large results with skip N | first M, or ask for count first.

Mutations

RuleBehavior
Two switchesWrites need a host that enables them and a request that allows them. rql-query can never write; rql-mutate must end with set or call (else invalid-plan).
All-or-nothingEvery target and value is resolved, converted and validated before the first write. If a write fails midway, the values already written are restored.
TargetsObjects with identity, or handle structs whose adapter writes through (Unity Scene). For set and a plain call, a scalar or a plain struct copy (get transform.position) is refused with invalid-plan (a source-qualified call takes any items); write through the owner instead: set transform.position.y = transform.position.y + 1.
Target limitAt most 200 targets (or bulk-create items) per call by default (newer plugin releases; older ones keep a fixed limit of 20) (mutation-limit, nothing written). The limit guards against a filter wider than intended, not against size: pass max_targets (up to 1000) for an intended bulk change, or narrow with where, first or ref(). Beyond 1000, split into batches (re-run with first 1000 when the change removes items from the filter).
Bulk createrange(0, N) or a list literal streams items, and call editor.Create…(… $ …) runs once per item: N new objects in one call and one undo step, every item checked before the first is created.
Arguments by nameOne object literal as the only argument binds its keys to parameter names; the rest keep their defaults: call CreateGameObject({name: "Crate", primitive: "Cube"}).
Map entries… | get properties | where Key ends-with "Color" | set Value = "#ffffff" writes through the map the entries came from.
Typos failA misspelt member that leaves set / call nothing to change is an unknown-member error (nothing changed). A real member that the matched items lack is a warning with 0 changes.
Object literalsset settings = {speed: 2, $type: "FastSettings"} builds a new value. Members not named get defaults, so patch single members with paths instead. Scene objects are never built from literals.
call validatorsMethods may declare a validator. It runs for every target before the first call, on dry runs too; a rejection is invalid-value and nothing is called.
call is not rolled backA method that throws stops the stage with call-threw; calls already completed stay done.
Dry rundry_run: true computes the receipt without writing. new is then the planned value.
UndoEach rql-mutate call is one undo step in the editor (Ctrl+Z).

Errors and diagnostics

A diagnostic has a severity, a code, a message and often a hint. Warnings do not stop the query. The codes are a closed set per release; treat an unknown code as a generic error. Engines add a few of their own: not-found and ambiguous from the find functions, and the not-saved warning after a write.

CodeSeverityWhen
syntax-errorerrorThe text does not parse. The message gives the position.
invalid-planerrorA structurally invalid query: a terminal stage that is not last, a mutation request without set / call, a scalar mutation target.
version-unsupportederrorA QueryPlan with an unknown protocol version.
unknown-sourceerrorThe first path segment is not a registered source. Comes with suggestions.
unknown-stage · unknown-functionerrorNo such stage or function is registered.
unknown-memberwarning / errorNo evaluated item had that member. The hint names the closest members ("did you mean …?"), nested struct members and the types that do have it. An error when such a typo leaves set / call nothing to change.
unknown-metawarningAn unknown $name meta member.
no-matchwarningAn x is T test was false for every item. The hint says where T objects are reachable.
type-mismatcherror / warningWrong operand kinds, or a condition that is not a boolean (where material instead of where material != null). As a warning: an aggregate ignored values (it says how many).
arityerrorWrong number of arguments.
div-by-zeroerrorDivision or modulo by zero.
getter-threw · call-threw · function-threwerrorA member read, a called method or a host function threw.
hook-threwwarningA host hook threw after the writes were committed.
invalid-regexerrorA matches pattern does not compile.
stale-referrorref() points to an object that no longer exists. Re-query for a fresh $ref.
permission-deniederrorset / call in a read-only request, or a member or method the host does not allow.
readonly-membererrorThe member cannot be written (identity members are always read-only).
coercion-failederrorThe value cannot be converted to the member type.
invalid-valueerrorThe value converts, but the host's validation rejects it (also a call validator), or max_targets is outside 1 to 1000.
mutation-limiterrorMore targets than the target limit. Nothing was changed. The message says how many matched; the hint gives the max_targets that would cover them.
budget-exceedederror / warningToo many objects visited; partial results are discarded. As a warning: recurse max-depth was clamped to maxDepth (the rows are kept).
timeouterror / warningThe query ran out of time, or one regex match did (warning).
output-truncatedwarningThe rows were cut to the output size budget. For a receipt, only the listing is cut: every change was made.
unsupportederrorThe runtime cannot do this, e.g. text sent to a plan-only runtime.
internal-errorerrorA runtime bug reported as a diagnostic instead of a crash.

Budgets and limits

Every query runs under budgets. The engine plugins use the defaults below. The only one a tool call can raise is the target limit: rql-mutate takes max_targets in newer plugin releases (older ones have no parameter and a fixed limit of 20).

BudgetDefaultHard capOn exceed
maxRows (returned rows / items)5010 000Truncation (N of M (truncated; …)), not an error.
maxVisited (items, recursion nodes, method elements)1 000 0005 000 000budget-exceeded.
timeoutMs2 00030 000timeout.
maxListItems (per encoded list)20–Truncation marker …+N.
maxDepth (recurse cap)16–Clamp plus a budget-exceeded warning.
recurse default depth8–max-depth=N overrides it.
maxOutputBytes65 536–Rows cut plus output-truncated.
Target limit (max_targets)200 in newer plugin releases (older ones and the library default: 20, fixed)1 000mutation-limit, nothing written. Raise it per call with max_targets.

Engine caps on top: asset and resource lists return at most 200 entries; the console sources keep the last 1000 log entries in Unity and Godot and 10 000 in Unreal; Godot's files lists at most 20 000.

Security

RQL treats query text from an agent as untrusted input that runs inside the editor process.

  • No arbitrary code execution. No eval and no file-system or process access in the language. call reaches only methods the host allowlists ([RqlCallable] in .NET, or methods an adapter adds); anything else is permission-denied.
  • Only exposed members are read. A getter that throws becomes an error value plus a getter-threw warning.
  • Identity is read-only. The member behind $ref can never be written.
  • Stale references are detected. A destroyed object reads as null, and ref() to it is stale-ref.
  • Regexes are bounded. The .NET runtime limits each matches to 50 ms.
Residual risk

The policy limits what can be written, not whether the change was wise. Hosts should allowlist destructive methods sparingly, and dry runs are worth using for bulk edits.

RQL in the engines

The language is the same everywhere. What differs is the object model: the sources, the member names, the host functions and calls, and what happens after a write. In each engine, rql-schema lists all of it, including what installed extensions add.

UnityUnreal EngineGodot
Runtime in the editor.NET assemblies (Rql.Contracts, Rql.Parser, Rql.Execution), Editor-onlyC++ runtime inside the plugin; the unreal-mcp-bridge sidecar (.NET) parses the text.NET NuGet com.IvanMurzak.Rql, editor builds only
Every objectobjects (GameObjects)actorsnodes
Hierarchy rootsrootsactors | where Parent == nullroot
Find by name / pathunity.find("Level/Pillar_1")unreal.find("Lamp") (label, name or path)godot.find("Level/Player")
Assetsunity.assets("t:Material"), unity.asset(path)unreal.assets("StaticMesh", "/Game/Props"), unreal.asset(path)godot.resources("StandardMaterial3D"), godot.resource(path)
Member namesC# members: transform.position, intensityReflected property names (Intensity, bHidden, RelativeLocation) plus added members such as Label, LocationC# properties Position, plus props["snake_case"]
$refGameObject#<id>PointLight#<id> (valid for the editor session)Node3D#<instance id>
UndoOne Undo group "RQL mutation"One editor transaction "RQL: <query>"One undo step "RQL: <query>" (a change to both scene and files records a scene part and a file part, undone together)
Bulk createrange(0, N) | call editor.CreateGameObject(…), editor.InstantiatePrefab(…)range(0, N) | call editor.SpawnActor(…)range(0, N) | call editor.CreateNode(…), editor.InstantiateScene(…)
Saving after a writeSaves changed assets, the open prefab and dirty scenes (not untitled scenes, not in Play Mode)Nothing is saved, except Project Settings and gameplay-tag edits (written to their .ini at once, not undoable). Call SaveLevel / SaveAll / SaveAssetResource files are saved. Scene edits mark the scene unsaved; call editor | call SaveScene()

Unity

Since Unity-MCP 1.0.0, RQL is the plugin's data layer: GameObjects, components, assets, scenes, prefabs, console logs, the profiler and Editor state are all read and changed through RQL. Members are the C# members (public and [SerializeField]).

Sources

SourceItems
objectsEvery GameObject in the loaded scenes, depth-first, inactive ones included.
rootsRoot GameObjects of the loaded scenes.
scenesLoaded scenes: name path buildIndex isLoaded isDirty rootCount roots; calls Save(), SaveAs(path), SetActive(), Close().
selectionObjects selected in the Editor.
prefabThe root GameObject of the prefab open in prefab editing mode (none otherwise).
consoleCaptured Editor log entries, oldest first (last 1000): logType message timestamp stackTrace sequence.
shadersEvery shader the Editor knows: name supported hasErrors.
componentTypesComponent types that can be added: name fullName namespace.
tests · testResultsTest methods (fullName name fixture namespace assembly mode categories …) and the results of the last tests-run.
profilerLive profiler snapshots: memory rendering script frame modules; calls Start, Stop, ClearFrames, EnableModule, Save, Load.
lightingThe active scene's lighting: environment (ambient, fog, skybox, sun), the Lighting Settings asset, baking.
settingsProject Settings: physics, time, quality, player, build (writable, saved and undoable; build.scenes lists the scenes in the build).
editorEditor state (isPlaying isPaused isCompiling selection unityVersion projectPath layers tags) and operations (below).

Functions

FunctionReturns
unity.assets(filter, folder?)An AssetDatabase search such as "t:Material" or "t:Prefab Enemy", at most 200 assets, loaded lazily.
unity.asset(path)The main asset at a path, or null.
unity.find(nameOrPath)The GameObject with that hierarchy path or unique name. not-found / ambiguous otherwise.
ref("GameObject#1234")Resolves a $ref from an earlier result.

Object model

  • GameObject: name, active (writes call SetActive), tag (a defined tag), layer (0–31), staticFlags (list of names), transform, components, children.
  • Transform: position, localPosition, eulerAngles, localScale, parent (writable, keeps the world position), root.
  • Components: find them with objects | get components | where $ is Light; each has gameObject and transform.
  • Material: name shader renderQueue … plus properties["_Color"], typed per shader property. Renderer material / materials are the shared materials.
  • Values: vectors, quaternions and colors print as (x, y, z); write "(1, 2, 3)", [1, 2, 3] or {x: 1, y: 2, z: 3}; colors also "#ff8800". Prefer eulerAngles for rotations. An asset path string ("Assets/…") works wherever an asset is expected.

Calls

OnMethods
editorCreateGameObject(name, parent?, primitive?, position?, rotation?, scale?) or CreateGameObject(name, {primitive, parent, position, rotation, scale}) · InstantiatePrefab(path, parent?, position?, rotation?, scale?) or InstantiatePrefab(path, {parent, position, rotation, scale}) · AddLayer(name) · AddTag(name) · OpenScene(path, additive?) · NewScene(path, empty?, additive?) · SaveScenes() · OpenPrefab(path) · SavePrefab() · ClosePrefab(save?) · CopyAsset(path, newPath) · MoveAsset(path, newPath) · DeleteAsset(path, force?) · CreateFolder(path) · CreateMaterial(path, shader?) · SaveAssets() · RefreshAssets() · ClearConsole() · ExecuteMenuItem(path)
GameObjectAddComponent(type) · Destroy() · Duplicate() · SaveAsPrefab(path) · ApplyPrefabOverrides() · RevertPrefabOverrides() · LookAt(target) (a GameObject or a position)
ComponentDestroy() (refused for Transform and for components another one requires)
SceneSave() · SaveAs(path) · SetActive() · Close()

Examples

Queries (rql-query):

objects | where name contains "Enemy" and active | select $ref name transform.position
objects | get components | where $ is Light and intensity > 2 | select gameObject.name intensity color
roots | recurse children | where components.count() == 1 | select $path name
unity.assets("t:Material") | select name shader.name properties["_Color"]
console | where logType == "Error" | sort sequence desc | first 5 | select message
scenes | select name path isDirty rootCount
componentTypes | where name contains "Collider" | select name
editor | select isPlaying isPaused selection
settings | select physics.gravity time.fixedDeltaTime quality.levels

Changes (rql-mutate):

objects | where name == "Player" | set transform.position = "(0, 1, 0)"
objects | get components | where $ is Light | set intensity = intensity * 2, color = "#ffcc88"
objects | where tag == "Enemy" | set active = false
objects | where name starts-with "Pillar_" | set name = name.replace("Pillar_", "Column_")
objects | where name starts-with "Coin" | set transform.localScale = transform.localScale * 1.5
objects | where name starts-with "Enemy" and distance(transform.position, unity.find("Player").transform.position) < 10 | set active = false
unity.asset("Assets/Mats/Red.mat") | set properties["_Color"] = "(1, 0, 0, 1)"
editor | call CreateGameObject("Crate", ref("GameObject#1234"), "Cube")
range(0, 150) | call editor.CreateGameObject("Cube_" + $, {primitive: "Cube", position: [($ % 15) * 2, 0, floor($ / 15) * 2]})
editor | call CreateGameObject({name: "Crate", primitive: "Cube", position: [1, 0, 2], scale: [2, 2, 2]})
objects | where name == "Crate" | call AddComponent("Rigidbody")
objects | where name == "Lamp" | set transform.parent = ref("GameObject#1234")
editor | call InstantiatePrefab("Assets/Prefabs/Enemy.prefab", {parent: ref("GameObject#1234"), position: [0, 0, 5]})
scenes | where path == "" | call SaveAs("Assets/Scenes/New.unity")

From a terminal:

unity-mcp-cli run-tool rql-query --input '{"query": "objects | where name contains \"Enemy\" | select $ref name"}'

After a write, Unity-MCP saves changed assets, the open prefab and dirty scenes. An untitled scene is reported as a not-saved warning (save it with scenes | where path == "" | call SaveAs("Assets/Scenes/X.unity")); in Play Mode, scenes are not saved. Other tools take RQL too: tests-run accepts query over the tests source, and complex tool parameters are RQL values such as ref("GameObject#12") or unity.find("Name").

Unreal Engine

Unreal-MCP runs RQL's C++ runtime inside the editor. The C++ runtime executes QueryPlans only, so the unreal-mcp-bridge sidecar parses the query text with the .NET parser, answers syntax errors itself, and renders the result. Members are the reflected properties (EditAnywhere, VisibleAnywhere, BlueprintVisible) under their C++ names: bHidden, Intensity, RelativeLocation.

Sources

SourceItems
actorsEvery actor of the editor world's loaded levels, hidden ones included.
levelsThe loaded levels: Map IsPersistent IsCurrent IsVisible Actors.
worldThe editor world: Levels PersistentLevel CurrentLevel.
selectionThe actors selected in the editor.
consoleEditor log entries since startup, oldest first: Sequence Time Verbosity Category Message.
dataTables · blueprints · widgetBlueprints · levelSequencesAssets of that kind under /Game (at most 200).
gameplayTagsEvery registered gameplay tag: Name Comment Source Parent Children ….
settingsProject Settings and Editor Preferences sections: Container Category Section DisplayName Description Object.
editorEditor state (IsPlaying IsPaused Selection World CurrentLevel) and operations (below).

Functions

FunctionReturns
unreal.assets(class, path?)Assets of a class (empty = any) under a content path (default /Game), recursive, at most 200.
unreal.asset(path)The loaded asset, or null. A member path may follow: unreal.asset("/Game/BP_Door").EventGraph.
unreal.find(label)The actor with that label, name or path. not-found otherwise.
unreal.classes(base?, filter?)Classes derived from base (default "Actor") whose name contains filter, at most 500.
unreal.settings(section)A settings object by section name, display name or class ("Maps & Modes").
ref("PointLight#1234")Resolves a $ref from this editor session.

Object model

  • Every object: Id, Name, Path (read-only). $ref is Type#Id, valid for the current editor session.
  • Actor: Label, Location, Rotation, Scale (world transform, writable), Components, Children, Parent (writable: attach, keeps the world transform; null detaches), Folder, Level, HiddenInEditor.
  • Materials: maps Scalars, Vectors and Textures, writable on material instances.
  • Data: DataTable Rows["Sword"].Damage; gameplay tags are text (Tag == "Ability.Fire"); Blueprint graphs expose nodes and pins.
  • Values: Vector (x, y, z), Rotator (pitch, yaw, roll) in degrees, LinearColor (r, g, b, a) 0–1, Color 0–255; write "(1, 2, 3)", [1, 2, 3] or {X: 1, Y: 2, Z: 3}; colors also "#ff8800". An asset path such as "/Game/Meshes/SM_Cube" works as an object reference.
  • Class defaults are read-only. Edit the class or Blueprint instead.

Calls

OnMethods
editorSpawnActor(ClassName, Label?, Location?, Rotation?, Parent?, Scale?) · SpawnActorFromAsset(AssetPath, Label?, Location?, Rotation?, Parent?, Scale?) · OpenLevel(Path) · NewLevel(Path?, Template?) · SaveLevel(Path?) · SaveAll() · UnloadSublevel(Level) · CopyAsset(Source, Destination) · MoveAsset(Source, Destination) · DeleteAsset(Path, bForce?) · CreateFolder(Path) · RefreshAssets(Path?, bForce?) · CreateAsset(Path, ClassName) · CreateMaterialInstance(Path, Parent) · ImportAsset(File, Destination, Name?, bReplaceExisting?) · SaveAsset(Asset) · ClearConsole() · CreateDataTable(Path, RowStruct) · AddGameplayTag(Name, Comment?, Source?) · RemoveGameplayTag(Name) · RenameGameplayTag(Name, NewName)
ActorDestroy() · Duplicate(Offset?) · AddComponent(ClassName, Name?)
ComponentDestroy() (only components added to the instance)
Other objectsFunctions marked CallInEditor with no parameters; DataTable AddRow / RemoveRow / RenameRow / DuplicateRow; user-defined struct AddField / RemoveField / RenameField / SetFieldDefault; Blueprint Compile() / AddFunction; graph, pin, widget and sequence edits (see rql-schema).

Examples

Queries (rql-query):

actors | where Label contains "Enemy" | select $ref Label Location
actors | get Components | where $ is PointLightComponent and Intensity > 2 | select Owner.Label Intensity LightColor
actors | where Parent == null | recurse Children | select $depth Label
unreal.assets("MaterialInstanceConstant") | select Name Scalars Vectors
console | where Verbosity == "Error" | sort Sequence desc | first 5 | select Message
levels | select Map IsPersistent IsCurrent IsVisible
unreal.asset("/Game/Data/DT_Weapons") | get Rows | where Value.Damage > 10 | select Key Value.Damage
gameplayTags | where Name starts-with "Ability." | select Name Comment
unreal.asset("/Game/BP_Door").EventGraph | get Nodes | select $ref Title Pins.Name
actors | where $ is PointLight and distance(Location, unreal.find("Player").Location) < 1000 | select Label
actors | get Components | where $ is LightComponentBase | group-by $type | select key, count, avg = items.avg(Intensity)

Changes (rql-mutate):

actors | where Label == "Player" | set Location = "(0, 0, 100)"
actors | get Components | where $ is PointLightComponent | set Intensity = Intensity * 2, LightColor = "#ffcc88"
actors | where Label starts-with "Enemy" | set HiddenInEditor = true
actors | where Label starts-with "Coin" | set Scale = Scale * 1.5, Location = Location + [0, 0, 50]
actors | get Components | where $ is LightComponentBase | set Intensity = (Intensity > 5000 ? 5000 : Intensity)
unreal.asset("/Game/Input/IA_Jump") | set Triggers = [{$type: "InputTriggerHold", HoldTimeThreshold: 0.5}], Modifiers = append(Modifiers, {$type: "InputModifierNegate"})
unreal.asset("/Game/Materials/MI_Red") | set Scalars["Roughness"] = 0.2, Vectors["BaseColor"] = "(1, 0, 0, 1)"
editor | call SpawnActor("PointLight", "Lamp", "(0, 0, 300)")
range(0, 150) | call editor.SpawnActor("/Engine/BasicShapes/Cube", "Cube_" + $, [($ % 15) * 150, floor($ / 15) * 150, 50])
range(0, 10) | call editor.SpawnActor({ClassName: "PointLight", Label: "Lamp_" + $, Location: [$ * 300, 0, 300]})
actors | where Label == "Crate" | call AddComponent("StaticMeshComponent", "Mesh")
actors | where Label == "Crate" | call Duplicate("(200, 0, 0)")
editor | call CreateMaterialInstance("/Game/Materials/MI_Glow", "/Game/Materials/M_Base")
editor | call SaveAll()

From a terminal:

unreal-mcp-cli run-tool rql-query --input '{"query": "actors | where Label contains \"Enemy\" | select $ref Label"}'

Each rql-mutate call is one editor transaction. Changes are not saved to disk: call SaveLevel, SaveAll or SaveAsset. Exceptions: project settings and gameplay-tag edits are written to their ini files at once and cannot be undone.

Godot

Godot-MCP runs the .NET runtime in editor builds. Node members are the C# properties (Position, Rotation, Visible), matched case-insensitively. Every Godot property, GDScript variables included, is also reachable by its snake_case name in props["light_energy"].

Sources

SourceItems
nodesEvery node of the edited scene, depth-first, root first (internal children excluded).
rootThe root node of the edited scene.
selectionNodes selected in the editor.
scenesScenes open in the editor: path name active root; calls Open(), Save().
filesEvery file the editor filesystem knows (at most 20 000): path name dir ext type uid.
classesGodot classes (ClassDB): name parent canInstantiate isNode isResource.
foldersFolders of the project: path fileCount folderCount empty.
console · gameLogCaptured editor log lines, oldest first (last 1000): sequence logType message timestamp stackTrace; gameLog: what the game run from the editor printed (Sequence LogType Message StackTrace).
toolsEvery MCP tool of this editor, hidden ones included: name title visible description.
project · settingsProject settings (settings["section/key"], mainScene; calls such as SetSetting, AddInputAction, AddAutoload) and every setting as a row (name section value type changed).
inputActions · autoloads · groups · layersThe input map, autoloads in load order, node and global groups, and named layers.
editorEditor state (isPlaying playingScene editedScene selection godotVersion projectPath) and operations (below).

Functions

FunctionReturns
godot.resources(type, folder?)Resources of a class, subclasses included (empty type = any), at most 200, loaded lazily.
godot.resource(path)A res:// or uid:// resource, or null.
godot.find(nameOrPath)A node by unique name or by path below the scene root ("Level/Player"). not-found / ambiguous otherwise.
godot.group(name)The nodes of a group.
godot.callable(target, method)A Callable of a method on a node (path or node), a resource (res://) or Class#id, e.g. godot.callable("Player", "_on_hit").
ref("Node3D#1234")Resolves a $ref (a Godot instance id).

Object model

  • Any object: id, class (GDExtension classes too), props["snake_name"], layerNames["collision_mask"].
  • Node: name (writable, validated), path (below the root, "." = root), parent, children, childCount, index, script, groups, signals, connections, incoming.
  • Resource: path, uid, Save().
  • Values: Vector2/3/4 and Color print as (…); write "(0, 1, 0)", a list or an object literal; colors also "#ff8800". Transform3D is 12 numbers, Callable is "Player::_on_hit", RIDs are read-only. A string becomes an object: res:// / uid:// loads a resource, anything else is a node path or name.

Calls

OnMethods
editorCreateNode(class, {name, parent, position, …}) · InstantiateScene(path, {name, parent, position, …}) · NewScene(path, rootClass?, rootName?) · OpenScene(path) · SaveScene(path?) · SaveAllScenes() · PlayScene(path?) · StopScene() · ClearConsole() · CreateResource(path, className?) · MoveResource(path, newPath) · DeleteResource(path, force?) · CreateFolder(path) · Reimport(files?)
NodeAddChild(class, name?) · InstantiateScene(path, name?) · Duplicate() · Free() · Reparent(parent, keepGlobalTransform?) · MoveChild(index) · Connect(signal, target, method, deferred?, oneShot?) · Disconnect(signal, target, method) (or Disconnect() on a row of connections) · AddToGroup(group) · RemoveFromGroup(group)
Any objectCallMethod(method, args?) (refused for methods of non-@tool scripts)
ResourceSave(), plus TileSet, Theme, ShaderMaterial and MeshLibrary edits (see rql-schema)

Examples

Queries (rql-query):

nodes | where name contains "Enemy" | select $ref name class path
nodes | where $ is Node3D and Position.Y > 0 | select name Position
nodes | where class == "OmniLight3D" | select name props["light_energy"] props["light_color"]
root | recurse children | where childCount == 0 | select path class
godot.resources("StandardMaterial3D") | select path props["albedo_color"]
files | where ext == "tscn" | select path
console | where logType == "Error" | sort sequence desc | first 5 | select message
nodes | where name == "Player" | get incoming | select source signal method
inputActions | where builtIn == false | select name events
nodes | where $ is Node3D | group-by class | select key, count, avgY = items.avg(Position.Y)
nodes | where $ is Node3D | select name kind=($ is MeshInstance3D ? "mesh" : $ is Light3D ? "light" : "other")

Changes (rql-mutate):

nodes | where name == "Player" | set Position = "(0, 1, 0)"
nodes | where class == "OmniLight3D" | set props["light_energy"] = props["light_energy"] * 2, props["light_color"] = "#ffcc88"
godot.resource("res://materials/red.tres") | set props["albedo_color"] = "(1, 0, 0, 1)"
root | call AddChild("Node3D", "Props")
range(0, 100) | call editor.CreateNode("MeshInstance3D", {name: "Cube" + $, parent: "Props", position: [($ % 10) * 2, 0, floor($ / 10) * 2], mesh: {class: "BoxMesh"}})
nodes | where name starts-with "Cube" | set Scale = Scale * 1.5
nodes | where name == "Floor" | set Mesh = {$type: "PlaneMesh", Size: "(20, 20)"}
nodes | where name == "Props" | call InstantiateScene("res://scenes/enemy.tscn")
nodes | where name == "Crate" | call Reparent(godot.find("Props"))
nodes | where name == "Enemy1" | call Connect("tree_exited", godot.find("Player"), "_on_enemy_died")
project | call AddInputAction("jump", ["Key:Space", "JoypadButton:A"])
editor | call SaveScene()

From a terminal:

godot-cli run-tool rql-query --input '{"query": "nodes | where name contains \"Enemy\" | select $ref name"}'

Each rql-mutate call is one undo action. A changed resource file is saved at once; edits to the scene's nodes only mark the scene unsaved, so finish with editor | call SaveScene(). Changed project settings are saved to project.godot. Complex parameters of other tools are RQL values too, e.g. godot.find("Player") for a node.

Runtimes and availability

WhereStatus
.NETReference runtime and text parser; NuGet com.IvanMurzak.Rql. Used by Unity-MCP and Godot-MCP, and by the Unreal-MCP sidecar for parsing and rendering.
TypeScriptParser and runtime with identical plans; host function sources, the adapter kernel and modules are pending.
C++Executes QueryPlans (no text parser, by design); vendored into Unreal-MCP.
EngineStatus
UnityYes. The Unity extensions add RQL modules instead of MCP tools.
Unreal EngineYes (C++ runtime plus the .NET sidecar).
GodotYes, in editor builds.
Brutal SoonComing soon. No plugin yet.

Extensions are RQL modules

The Unity extensions (Animation, Cinemachine, Navigation, Particle System and the rest) add no MCP tools. Each contributes an RQL module: type adapters, sources (for example navigation), functions, and an agent guide that is rendered into the unity-rql skill. You can extend the agent for your own project types the same way.

GuideTeach the agent your own types

Write a type adapter and an IRqlModule in your project's Editor code — see Custom type adapters.

License

RQL is source-available under the PolyForm Shield License 1.0.0: free to use, including in commercial products, except to provide a product that competes with the licensor's products. It is not an OSI open-source license. The engine plugins themselves are Apache-2.0; the RQL code they ship keeps its PolyForm Shield license.

Custom type adapters →RQL spec on GitHub →Unity best practices →