CUE — 18 Operations for AI Agents
CUE unifies configuration and validation — constraints, schemas, and data in one language, often guarding Kubernetes manifests. act101 navigates definitions and constraints structurally, so agents see what a value is allowed to be, not just what it is.
This page is the canonical reference an AI coding agent uses to refactor, query, and analyze CUE code through the act MCP server. 18 operations available: 0 refactor, 18 query, 0 analysis. Each operation is callable from Claude Code, Cursor, Codex, OpenCode, or any MCP-compatible agent host. Click any operation for a stable anchor link suitable for citation.
Worked CUE examples
act101 reads a CUE file's package clause, its let clauses, and its top-level field definitions: the skeleton tags a package clause and a let clause as function, and every top-level field definition, whether it holds a scalar, a struct, or a #Definition constraint, as class. symbols reports the same top-level names plus every field nested inside a struct, all as field. The unit of structure in this grammar is the field: a CUE constraint like #Pin and the struct that embeds three of them are both, at the query level, just fields whose value happens to be a struct. Each example below is the verbatim output of the command shown, run against the file shown. Query outputs are pretty-printed with the timing block omitted.
Read the package and its top-level fields as a skeleton
pinmap.cue defines a reusable #Pin constraint and a gpio struct that embeds three pins, plus a scalar boardName field, all in package firmware.
$ act query skeleton pinmap.cue
Before
package firmware
#Pin: {
number: int & >=0 & <=39
mode: "input" | "output" | "pwm"
pull?: "up" | "down" | "none"
}
gpio: {
statusLed: #Pin & {number: 2, mode: "output"}
buttonA: #Pin & {number: 4, mode: "input", pull: "up"}
buzzer: #Pin & {number: 18, mode: "pwm"}
}
boardName: "esp32-devkit-v1"
Output
{
"type": "Skeleton",
"declarations": [
{
"kind": "function",
"name": "firmware",
"range": {
"start": {
"file": "pinmap.cue",
"line": 1,
"column": 1,
"byte_offset": 0
},
"end": {
"file": "pinmap.cue",
"line": 1,
"column": 17,
"byte_offset": 16
}
},
"name_range": {
"start": {
"file": "pinmap.cue",
"line": 1,
"column": 9,
"byte_offset": 8
},
"end": {
"file": "pinmap.cue",
"line": 1,
"column": 17,
"byte_offset": 16
}
}
},
{
"kind": "class",
"name": "#Pin",
"range": {
"start": {
"file": "pinmap.cue",
"line": 3,
"column": 1,
"byte_offset": 18
},
"end": {
"file": "pinmap.cue",
"line": 7,
"column": 2,
"byte_offset": 121
}
},
"name_range": {
"start": {
"file": "pinmap.cue",
"line": 3,
"column": 1,
"byte_offset": 18
},
"end": {
"file": "pinmap.cue",
"line": 3,
"column": 5,
"byte_offset": 22
}
}
},
{
"kind": "class",
"name": "gpio",
"range": {
"start": {
"file": "pinmap.cue",
"line": 9,
"column": 1,
"byte_offset": 123
},
"end": {
"file": "pinmap.cue",
"line": 13,
"column": 2,
"byte_offset": 282
}
},
"name_range": {
"start": {
"file": "pinmap.cue",
"line": 9,
"column": 1,
"byte_offset": 123
},
"end": {
"file": "pinmap.cue",
"line": 9,
"column": 5,
"byte_offset": 127
}
}
},
{
"kind": "class",
"name": "boardName",
"range": {
"start": {
"file": "pinmap.cue",
"line": 15,
"column": 1,
"byte_offset": 284
},
"end": {
"file": "pinmap.cue",
"line": 15,
"column": 29,
"byte_offset": 312
}
},
"name_range": {
"start": {
"file": "pinmap.cue",
"line": 15,
"column": 1,
"byte_offset": 284
},
"end": {
"file": "pinmap.cue",
"line": 15,
"column": 10,
"byte_offset": 293
}
}
}
]
}
The skeleton reports firmware as a function (the package clause) and #Pin, gpio, and boardName as class declarations — the scalar boardName gets the same kind as the struct-valued gpio.
List every pin's fields as symbols
Each of statusLed, buttonA, and buzzer embeds #Pin and sets its own number and mode; buttonA also sets the optional pull field.
$ act query symbols pinmap.cue
Before
package firmware
#Pin: {
number: int & >=0 & <=39
mode: "input" | "output" | "pwm"
pull?: "up" | "down" | "none"
}
gpio: {
statusLed: #Pin & {number: 2, mode: "output"}
buttonA: #Pin & {number: 4, mode: "input", pull: "up"}
buzzer: #Pin & {number: 18, mode: "pwm"}
}
boardName: "esp32-devkit-v1"
Output
{
"type": "Symbols",
"symbols": [
{
"name": "firmware",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 1,
"column": 9,
"byte_offset": 8
},
"end": {
"file": "pinmap.cue",
"line": 1,
"column": 17,
"byte_offset": 16
}
},
"visibility": "unknown"
},
{
"name": "#Pin",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 3,
"column": 1,
"byte_offset": 18
},
"end": {
"file": "pinmap.cue",
"line": 3,
"column": 5,
"byte_offset": 22
}
},
"visibility": "unknown"
},
{
"name": "number",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 4,
"column": 2,
"byte_offset": 27
},
"end": {
"file": "pinmap.cue",
"line": 4,
"column": 8,
"byte_offset": 33
}
},
"visibility": "unknown"
},
{
"name": "mode",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 5,
"column": 2,
"byte_offset": 53
},
"end": {
"file": "pinmap.cue",
"line": 5,
"column": 6,
"byte_offset": 57
}
},
"visibility": "unknown"
},
{
"name": "gpio",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 9,
"column": 1,
"byte_offset": 123
},
"end": {
"file": "pinmap.cue",
"line": 9,
"column": 5,
"byte_offset": 127
}
},
"visibility": "unknown"
},
{
"name": "statusLed",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 10,
"column": 2,
"byte_offset": 132
},
"end": {
"file": "pinmap.cue",
"line": 10,
"column": 11,
"byte_offset": 141
}
},
"visibility": "unknown"
},
{
"name": "number",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 10,
"column": 21,
"byte_offset": 151
},
"end": {
"file": "pinmap.cue",
"line": 10,
"column": 27,
"byte_offset": 157
}
},
"visibility": "unknown"
},
{
"name": "mode",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 10,
"column": 32,
"byte_offset": 162
},
"end": {
"file": "pinmap.cue",
"line": 10,
"column": 36,
"byte_offset": 166
}
},
"visibility": "unknown"
},
{
"name": "buttonA",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 11,
"column": 2,
"byte_offset": 179
},
"end": {
"file": "pinmap.cue",
"line": 11,
"column": 9,
"byte_offset": 186
}
},
"visibility": "unknown"
},
{
"name": "number",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 11,
"column": 21,
"byte_offset": 198
},
"end": {
"file": "pinmap.cue",
"line": 11,
"column": 27,
"byte_offset": 204
}
},
"visibility": "unknown"
},
{
"name": "mode",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 11,
"column": 32,
"byte_offset": 209
},
"end": {
"file": "pinmap.cue",
"line": 11,
"column": 36,
"byte_offset": 213
}
},
"visibility": "unknown"
},
{
"name": "pull",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 11,
"column": 47,
"byte_offset": 224
},
"end": {
"file": "pinmap.cue",
"line": 11,
"column": 51,
"byte_offset": 228
}
},
"visibility": "unknown"
},
{
"name": "buzzer",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 12,
"column": 2,
"byte_offset": 237
},
"end": {
"file": "pinmap.cue",
"line": 12,
"column": 8,
"byte_offset": 243
}
},
"visibility": "unknown"
},
{
"name": "number",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 12,
"column": 21,
"byte_offset": 256
},
"end": {
"file": "pinmap.cue",
"line": 12,
"column": 27,
"byte_offset": 262
}
},
"visibility": "unknown"
},
{
"name": "mode",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 12,
"column": 33,
"byte_offset": 268
},
"end": {
"file": "pinmap.cue",
"line": 12,
"column": 37,
"byte_offset": 272
}
},
"visibility": "unknown"
},
{
"name": "boardName",
"kind": "field",
"range": {
"start": {
"file": "pinmap.cue",
"line": 15,
"column": 1,
"byte_offset": 284
},
"end": {
"file": "pinmap.cue",
"line": 15,
"column": 10,
"byte_offset": 293
}
},
"visibility": "unknown"
}
]
}
symbols lists all 16 fields, including the repeated number and mode inside statusLed, buttonA, and buzzer, and the single pull field that only buttonA sets.
Query
18 query tools, the same on every supported language. Descriptions live in the shared reference: /docs/query-tools.
callers control_flow data_flow definition diagnostics effect_closure effect_summary fix_auto get_type graph import_organize interface mutations references repo_outline skeleton symbols symbols_batch