Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Engine reference — generated from the canonical engineering source. Do not edit this page by hand.

Tool Reference

Luna registers 92 built-in tools from the tool loader (core/tools/_loader.lua) on a fully-provisioned host. Registration is probe-honest per tool: 51 tools register unconditionally, 19 register only when their backing binary is detected at startup (13 general + the 6 desktop-environment tools), 10 register when their Lua module loads, and 12 computer-use tools are gated on a real display probe plus a required-binary census. The 74 non-computer-use built-ins are therefore 51 always + 13 binary-probed + 10 module-probed; the remaining 18 are the 12 computer-use + 6 desktop-environment probe-conditional block. computer_use_force = true overrides the CU display gate for the rare remote-X posture — the tools then register and their handlers fail typed on absent binaries (the runtime refusal stays as defense-in-depth). Every condition is recorded in the registration_probe census of ci/tools_manifest.json, machine-checked against the registration source by ci/tools_manifest_lint.py, and the taxonomy numbers above are derived from that census by ci/tools_taxonomy_parity_lint.py (no hand-copied counts). Dynamic MCP tools (mcp__), workspace custom tools (custom__), and plugin tools (plugin__) join these at runtime. All built-ins are prefixed builtin__ on the wire; the bare name shown below is accepted as an alias. Permission modes and per-mode rulesets control which tools are available (see permissions.md).

File Operations

bash

Execute shell commands in the working directory.

ParameterTypeRequiredDescription
commandstringYesShell command to execute
timeoutnumberNoTimeout in milliseconds (clamped to tool_timeout_max_ms, default max 600000)

Default timeout is config.tool_timeout_ms (60000 ms when unset); the model-supplied value is clamped to a floor of 1 ms and a ceiling of tool_timeout_max_ms (default max 600000 ms) Output limited to 16KB (truncated beyond that) Runs in the current working directory Exit code included in result Commands run through the command policy (core.command_policy) — denied commands fail with Command blocked by policy

Example:

> Run `git status` to check for uncommitted changes

read_file

Read file contents with optional line range. Automatically detects image files and returns base64-encoded content blocks for vision-capable models.

ParameterTypeRequiredDescription
pathstringYesAbsolute file path
offsetnumberNoStarting line number (1-indexed)
limitnumberNoMaximum lines to read

Image files are returned as vision content blocks only when the current model supports vision; otherwise a (binary image file:...) placeholder is returned Paths outside the workspace boundary are rejected The current file content is pushed onto the undo stack before a later edit

write_file

Create or overwrite a file atomically.

ParameterTypeRequiredDescription
pathstringYesFile path
contentstringYesFile content

Max size: 10MB (MAX_WRITE_SIZE) Uses atomic write (mkostemp in the target directory, then rename) Paths outside the workspace boundary are rejected Queued through the mutation queue to prevent race conditions Pushes prior content onto the undo stack; git snapshots are debounced after mutating tools complete

edit_file

Search and replace in an existing file. Tries exact match first, then fuzzy matching (whitespace normalization, indentation, single-line fuzzy).

ParameterTypeRequiredDescription
pathstringYesFile path
old_textstringYesText to find
new_textstringYesReplacement text
replace_allbooleanNoReplace all occurrences instead of requiring uniqueness

With replace_all unset, exact matches must be unique; otherwise the fuzzy matcher (core.fuzzy_match) runs language-aware strategies and reports which strategy matched Fuzzy edits are written via atomic tmp + rename Fails with old_text not found in file (exact and fuzzy) when nothing matches Queued through the mutation queue to prevent race conditions Pushes prior content onto the undo stack

multi_edit

Edit multiple files atomically in a single tool call. If any edit fails, all changes are rolled back.

ParameterTypeRequiredDescription
editsarrayYesArray of edit objects

Each edit object:

FieldTypeRequiredDescription
file_pathstringYesPath to the file
old_stringstringYesText to find
new_stringstringYesReplacement text

Each file’s original content is backed up before editing; a failure restores every backup All edits are applied atomically — partial failures roll back all changes

apply_patch

Apply a unified diff patch to files.

ParameterTypeRequiredDescription
patchstringYesUnified diff text

Applies hunks atomically per file

list_directory

List files and directories in a given path.

ParameterTypeRequiredDescription
pathstringYesDirectory path

Returns one name (type) entry per line Does not recurse into subdirectories (use glob_search with ** for recursive listing)

create_directory

Create a directory and any necessary parent directories (like mkdir -p).

ParameterTypeRequiredDescription
pathstringYesDirectory path

Creates all intermediate directories if they don’t exist

delete_file

Delete a file from the filesystem.

ParameterTypeRequiredDescription
pathstringYesPath to delete

Deletes files (an empty directory is removable via os.remove; a non-empty directory fails) Queued through the mutation queue to prevent race conditions

notebook

Read and edit Jupyter notebook cells (.ipynb files).

ParameterTypeRequiredDescription
commandstringYesOperation: list_cells, read_cell, edit_cell, add_cell
file_pathstringYesPath to the .ipynb file
cell_indexnumberNoCell index (0-based, for read_cell/edit_cell)
contentstringNoCell content (for edit_cell/add_cell)
cell_typestringNocode or markdown (for add_cell, default: code)

Parses and validates notebook JSON structure Cell indices are 0-based edit_cell writes go through the workspace write-path guard

notebook_sync

Convert between Jupyter notebooks and text files using jupytext.

ParameterTypeRequiredDescription
actionstringYesConversion direction (e.g. notebook_to_script, script_to_notebook)
input_pathstringYesSource .ipynb or script path
output_pathstringNoDestination path
formatstringNojupytext script format

Requires jupytext on PATH

format_file

Format a source file using the appropriate formatter for its language.

ParameterTypeRequiredDescription
pathstringYesFile path
formatterstringNoForce a specific formatter
dry_runbooleanNoReport what would change without writing

Supports Python (black + isort), Erlang (erlfmt), Lua (stylua), C/C++ (clang-format) Write-class: gated by RBAC write permission

lint_file

Lint a source file using all registered linters for its language.

ParameterTypeRequiredDescription
pathstringYesFile path
linterstringNoRestrict to a single linter

Supports Python (flake8 + pylint), Lua (luacheck) Write-class: gated by RBAC write permission

Find files matching a glob pattern.

ParameterTypeRequiredDescription
patternstringYesGlob pattern (supports ** recursive)
pathstringNoBase directory (default: workspace root)

Max 1000 results; beyond that a ... and N more results truncated line is appended Supports standard glob patterns: *, **, ?, [...] Results are returned in directory-walk order (not sorted by modification time)

Search file contents with a regex pattern.

ParameterTypeRequiredDescription
patternstringYesRegular expression pattern
pathstringNoBase directory (default: workspace root)
includestringNoFile pattern filter (e.g. *.lua)

Engine ladder: ripgrep → silver searcher → grep -P (Perl regex) → grep -E (extended regex) Returns matching lines with file paths and line numbers Max 250 matched lines Timeout defaults to config.tool_timeout_ms (30000 ms when unset)

Search code using language-server analysis or text search fallback.

ParameterTypeRequiredDescription
querystringYesSearch query (symbol name or text pattern)
search_typestringYesType: definition, references, symbols, text
file_pathstringNoLimit search to this file
languagestringNoLimit search to this language

Falls back to text-based grep when no language server is available Results truncated at 2KB

Code Intelligence

lsp

Query a language server for code intelligence operations (fused entry point).

ParameterTypeRequiredDescription
operationstringYesLSP operation (see below)
pathstringYesFile path (relative to workspace)
linenumberYesLine number (1-based)
characternumberYesColumn number (1-based)

Supported operations:

OperationDescription
goToDefinitionJump to the definition of the symbol at the given position
findReferencesFind all references to the symbol at the given position
hoverGet hover/type information for the symbol at the given position
documentSymbolList all symbols defined in the file (line/character not required)
diagnosticsGet diagnostic messages (errors/warnings) for the file

Requires a running language server for the file type (auto-started by the LSP manager) The same operations are also exposed as six individual tools below (lsp_definition, lsp_references, lsp_hover, lsp_completion, lsp_symbols) plus tree-sitter ts_query Diagnostics are also automatically injected into edit_file and write_file results

lsp_definition

Navigate to a symbol’s definition. Returns file path and line number.

ParameterTypeRequiredDescription
pathstringYesFile path
linenumberYesLine number (1-based)
characternumberYesColumn number (1-based)

lsp_references

Find all references to a symbol. Returns list of file, line, column, and text.

ParameterTypeRequiredDescription
pathstringYesFile path
linenumberYesLine number (1-based)
characternumberYesColumn number (1-based)

lsp_hover

Get hover documentation for a symbol. Returns type signature and doc string.

ParameterTypeRequiredDescription
pathstringYesFile path
linenumberYesLine number (1-based)
characternumberYesColumn number (1-based)

lsp_completion

Get code completion suggestions at a position. Returns list of completion items.

ParameterTypeRequiredDescription
pathstringYesFile path
linenumberYesLine number (1-based)
characternumberYesColumn number (1-based)

lsp_symbols

Get document symbols (outline with hierarchy). Returns symbol list with nesting.

ParameterTypeRequiredDescription
pathstringYesFile path

ts_query

Query code structure using tree-sitter syntax patterns. Returns structured results for named query types.

ParameterTypeRequiredDescription
file_pathstringYesSource file path
query_typestringYesOne of functions, classes, imports, exports, calls, symbols
languagestringNoForce language (auto-detected from extension otherwise)

ast_query

Query a source file’s syntax tree using tree-sitter patterns.

ParameterTypeRequiredDescription
file_pathstringYesSource file path
querystringYesTree-sitter query/pattern
languagestringNoForce language
formatstringNostructured or text output

code_stats

Get structure statistics for a source file.

ParameterTypeRequiredDescription
file_pathstringYesSource file path

symbol_lookup

Look up symbol definitions in the codebase using ctags. Returns structured list of {symbol, file, line, kind}.

ParameterTypeRequiredDescription
symbolstringYesSymbol name to look up
kindstringNoFilter by kind: function, variable, class, etc.
filestringNoFilter by file path pattern
generatebooleanNoForce regenerate tags file

ctags_run

Run ctags to generate or update a tags file. Returns raw output with stats.

ParameterTypeRequiredDescription
pathsarrayNoPaths to index
languagesstringNoLanguage filter
extrasstringNoExtra ctags options

Dev Tools

cmake_configure

Run cmake configure step. Generates build files.

ParameterTypeRequiredDescription
source_dirstringNoSource directory
build_dirstringNoBuild directory
generatorstringNoCMake generator
argsarrayNoExtra cmake arguments

cmake_build

Run cmake build step.

ParameterTypeRequiredDescription
build_dirstringNoBuild directory
targetstringNoBuild target
jobsnumberNoParallel jobs

runtime_list

List available runtimes and their versions via asdf.

ParameterTypeRequiredDescription
runtimestringNoRestrict to one runtime name

Code Execution

code_exec

Execute code in a sandboxed environment with resource limits.

ParameterTypeRequiredDescription
languagestringYesOne of python, lua, node, shell
codestringYesSource code to execute
timeoutnumberNoTimeout in seconds (default 30, clamped to max 120)
stdinstringNoOptional stdin input

Unsupported languages fail with unsupported language: <name>

Git

git

Execute read-only structured git operations in the workspace repository.

ParameterTypeRequiredDescription
commandstringYesRead sub-command (see below)
argsstringNoOptional arguments for the command
pathstringNoOptional file path (for diff)

Supported sub-commands (all safe/read-class):

CommandDescription
statusShow working tree status (--porcelain)
diffShow unstaged changes (optional file path)
logShow commit log (last 20, --oneline)
branchList all branches (-a)
showShow commit details
stash_listList stashed changes

Mutating sub-commands are not accepted here — the tool answers mutating operations (add, commit, stash, checkout) require the git_write tool Dangerous patterns are blocked in both command and args: force push, hard reset, clean, filter-branch, rebase, reflog expire, force branch delete, force worktree remove Force flags (-f, --force, -D) are rejected unless the command is an approved write-class command

git_write

Execute mutating git operations in the workspace repository. Write-class: gated by RBAC write permission — the read-granted git tool never mutates.

ParameterTypeRequiredDescription
commandstringYesOne of add, commit, stash, checkout
argsstringNoOptional arguments (e.g. commit message)
pathstringNoOptional file path (for add)

Same dangerous-pattern and force-flag blocklist as git

git_snapshot

Manage git snapshots for file-level undo and review. Snapshots are auto-created after mutating tools (write_file, edit_file, delete_file).

ParameterTypeRequiredDescription
commandstringYesOperation: list, diff
snapshot_idstringNoSnapshot commit hash (for diff)
countnumberNoNumber of snapshots to list (default: 10)

Snapshots use the [luna] commit prefix Restore is a SEPARATE write-class tool — git_snapshot_restore: snapshot restore is a workspace-mutating checkout, so the read-granted git_snapshot never exposes it; permission-gate restore through the write-class tool instead.

git_snapshot_restore

Restore files from a git snapshot. Write-class: mutates the workspace — requires write permission, never reachable via the read-granted git_snapshot.

ParameterTypeRequiredDescription
snapshot_idstringYesSnapshot commit hash to restore
filesarrayNoFile paths to restore (default: all files in the snapshot)

Integrated with undo_edit — snapshot restore is available through the undo stack

Web

web_fetch

Fetch content from a URL.

ParameterTypeRequiredDescription
urlstringYesURL to fetch (must start with http:// or https://)
formatstringNoResponse format: text (default) or markdown

Bodies over 1MB are rejected (response too large) Every redirect hop is re-validated by the shared fetch module (curl-side follow disabled) Gated by the sandbox network policy (execution.sandbox.network); per-host policy applies HTML is automatically stripped of scripts/styles/tags when format=text

Search the web using a configurable search backend (SearXNG or Brave Search API).

ParameterTypeRequiredDescription
querystringYesSearch query
max_resultsnumberNoMaximum results (default: 10)

Returns results with titles, URLs, and snippets SearXNG backend needs config.web_search_url; Brave backend needs config.brave_api_key

http_request

Make HTTP requests directly (GET, POST, PUT, PATCH, DELETE, HEAD).

ParameterTypeRequiredDescription
urlstringYesRequest URL
methodstringYesHTTP method: GET, POST, PUT, PATCH, DELETE, HEAD
headersobjectNoRequest headers
bodystringNoRequest body
timeoutnumberNoTimeout in milliseconds (default 10000 buffered / 30000 streaming, max 600000)
streambooleanNoStream response (for large bodies)
max_stream_bytesnumberNoMax bytes when streaming (default: 100KB)

Only http:// and https:// URLs allowed Response truncated at 10KB (use stream=true for larger responses) More flexible than web_fetch — supports all HTTP methods and custom headers

MCP

mcp_read_resource

Read a resource from an MCP server.

ParameterTypeRequiredDescription
uristringYesMCP resource URI
serverstringNoSpecific MCP server name (omitted = try all)

If no server is specified, tries all connected MCP servers

mcp_get_prompt

Get a prompt template from an MCP server.

ParameterTypeRequiredDescription
namestringYesPrompt template name
argumentsobjectNoTemplate arguments
serverstringNoSpecific MCP server name (omitted = try all)

Vision

attach_image

Attach an image file to the conversation for multimodal analysis. Supports PNG, JPEG, GIF, and WebP formats.

ParameterTypeRequiredDescription
pathstringYesAbsolute path to the image file

Max image size: 20MB Automatically detects MIME type from file content Requires a vision-capable model

Agent

clarify

Ask the user a clarifying question and wait for their response.

ParameterTypeRequiredDescription
questionstringYesThe question to ask
optionsarrayNoOptional list of choices for the user to select from
contextstringNoOptional context explaining why the question is being asked

mixture_of_agents

Run multiple agents on the same task and aggregate results.

ParameterTypeRequiredDescription
taskstringYesThe task for all agents
agentsintegerNoNumber of agents (default: 3)
strategystringNovote (synthesize best), best (longest output), or merge (combine all)

Ask-permission class: the user is consulted before the fan-out Requires a parent agent context

Session

todo

Manage a session-scoped task checklist for tracking progress on multi-step tasks.

ParameterTypeRequiredDescription
actionstringYesAction: list, add, update, remove
idstringNoTask ID (for update/remove)
textstringNoTask description (for add)
statusstringNoStatus: pending, in_progress, completed
prioritystringNoPriority: high, medium, low

Persists across turns within the session

undo_edit

Undo the last file edit(s), reverting to the original content.

ParameterTypeRequiredDescription
countnumberNoNumber of edits to undo (default: 1)

Maintains a stack of up to 50 undo entries Restores the file to its state before the edit Supports git snapshot undo when snapshots are available

Session Rollback

Use the /rollback [N] slash command to remove the last N conversation turns from the active message view. This is useful for recovering from unproductive tangents without losing the entire session.

Auto-branches before dropping turns (creates a snapshot) Returns branch ID and dropped turn count Works on the active message view, not compacted messages Default N = 1 if not specified

Example:

/rollback 3     # Remove last 3 turns, auto-branches first
/rollback       # Remove last turn

task

Spawn a sub-agent to handle a specific task in isolation with its own context.

ParameterTypeRequiredDescription
promptstringYesTask description for the sub-agent
toolsarrayNoRestrict sub-agent to these tools (default: same as parent)
backendstringNoBackend: local, zmq, team, background (default: local)

Sub-agent runs with its own context, up to 20 steps 60-second timeout per sub-agent Returns the sub-agent’s output to the parent conversation

background_spawn

Spawn a background sub-agent that runs asynchronously. Returns immediately with a task_id.

ParameterTypeRequiredDescription
promptstringYesTask description for the background sub-agent
toolsarrayNoRestrict sub-agent to these tools (default: same as parent)
timeoutnumberNoTimeout in seconds (default: 120)
callbackstringNoCallback name for result delivery

Collect results later via the background task check/await flow

check_background

List background sub-agent tasks: completed results (collected once, then removed) plus the ids still pending. Takes no parameters.

ParameterTypeRequiredDescription
———No parameters

await_background

Wait (bounded) for background sub-agent tasks to finish and return their results. With no ids, waits for every pending task.

ParameterTypeRequiredDescription
task_idstringNoA single background task id to await
task_idsarrayNoBackground task ids to await (default: all pending)
timeoutnumberNoWhole-wait budget in seconds (default 60, capped at 300)

Unknown/already-collected ids do not busy-wait; use check_background for the collected set.

read_tool_output

Read a persisted tool output by its handle (the tool_use_id or message id shown in a [persisted-output] marker). Use offset/limit for long outputs.

ParameterTypeRequiredDescription
handlestringYesHandle from the persisted-output marker
offsetnumberNoByte offset (default 0)
limitnumberNoMaximum bytes to read (default 4000, max 12000)

switch_mode

Switch the agent to a different operating mode during execution.

ParameterTypeRequiredDescription
modestringYesMode name (build, plan, explore, review, general, or custom)
reasonstringYesWhy the mode switch is needed

Available modes: build, plan, explore, review, general, plus user-defined modes Updates tool permissions, system prompt, and TUI badge immediately Subject to the agent.mode_switch_request hook (can be vetoed)

Search across all session message content using full-text search. Returns matching messages with highlighted snippets.

ParameterTypeRequiredDescription
querystringYesSearch query
limitnumberNoMaximum matches to return
summarizebooleanNoReturn a summarized result set

session_recent

List recent sessions with metadata (title, model, message count, date).

ParameterTypeRequiredDescription
limitnumberNoMaximum sessions to list

Team

Team work assignment is server-driven: enrolled workers receive signed team_directive frames (leader-attributed + HMAC-verified), and the team_mail tool below carries coordination messages. The retired team_spawn tool could never succeed — it posted an empty worker_id, which Sol refuses (400 invalid_worker_id); retired it.

team_mail

Send a message to team members via the team priority mailbox.

ParameterTypeRequiredDescription
team_idstringYesTeam ID
bodystringYesMessage body
tostringNoRecipient worker ID or all
subjectstringNoMessage subject
prioritystringNoPriority: high, normal, low

Messages are delivered via the team priority mailbox with TTL expiry Supports broadcast (to=all) and direct messaging

Goals

goal_create

Create a new goal for tracking progress on a multi-step task. Returns goal ID and metadata.

ParameterTypeRequiredDescription
objectivestringYesWhat the goal should achieve
tasksarrayNoInitial task list

goal_get

Get the current status and details of a goal by ID.

ParameterTypeRequiredDescription
goal_idstringYesGoal ID

goal_update

Update a goal’s status, progress, or notes.

ParameterTypeRequiredDescription
goal_idstringYesGoal ID
statusstringNoNew status
progressstringNoProgress note
notesstringNoFree-form notes

goal_list

List goals with optional status filter.

ParameterTypeRequiredDescription
statusstringNoFilter by status
limitnumberNoMaximum goals to list

Scheduler

schedule

Schedule a recurring or one-time task.

ParameterTypeRequiredDescription
expressionstringYesCron expression or natural language (every 5 minutes, at 3pm tomorrow)
commandstringNoShell command to execute (omit for reminder-only)
descriptionstringNoHuman-readable description

schedule_list

List scheduled tasks with their status and next run times.

ParameterTypeRequiredDescription
limitnumberNoMaximum jobs to list

schedule_cancel

Cancel a scheduled task by job ID.

ParameterTypeRequiredDescription
job_idstringYesScheduled job ID

Shares

session_share_create

Create a public share link for session data (messages, summaries, exports).

ParameterTypeRequiredDescription
session_datastringYesSession data to share
formatstringNoOutput format
ttl_daysnumberNoShare lifetime in days

Returns {share_id, url?} — url is only present when the server has base_url configured

session_share_get

Retrieve the data behind a session share link.

ParameterTypeRequiredDescription
share_idstringYesShare ID

Returns {data, format, created_at}; errors on not-found (404 — expired shares are indistinguishable from never-existed since )

System

port_check

Check which process is listening on a port or holding a file open. Requires lsof.

ParameterTypeRequiredDescription
portnumberNoPort to inspect
filestringNoFile to inspect

strace_process

Trace system calls of a running or newly spawned process. Summary mode by default. Requires strace. Max duration 30s.

ParameterTypeRequiredDescription
pidnumberNoExisting process ID to trace
commandstringNoSpawn and trace a new command
durationnumberNoTrace duration in seconds
filterstringNoSyscall filter

numa_info

Get NUMA topology and hardware core information. Requires numactl.

ParameterTypeRequiredDescription
(none)

json_from_shell

Generate JSON from shell arguments using jo. Example: jo name=test count=42. Requires jo.

ParameterTypeRequiredDescription
argsarrayYesjo-style key=value arguments

Containers

container_list

List containers. Returns structured [{id, name, image, status, ports}].

ParameterTypeRequiredDescription
allbooleanNoInclude stopped containers
filterstringNoFilter by name

container_run

Run a container. Returns container ID.

ParameterTypeRequiredDescription
imagestringYesContainer image
commandstringNoCommand to run in the container
namestringNoContainer name
rmbooleanNoRemove container on exit
detachbooleanNoRun detached

SSH

ssh_agent_status

Show SSH agent status via keychain. Returns structured agent info, key fingerprints, and environment.

ParameterTypeRequiredDescription
actionstringNoSub-action
key_pathstringNoSpecific key path

Utility

calculator

Evaluate mathematical expressions safely (no code execution).

ParameterTypeRequiredDescription
expressionstringYesMath expression using +, -, *, /, ^, sqrt, sin, cos, tan, log, floor, ceil, abs, min, max, pi, e

Safe evaluation — expressions run in a restricted math-only environment Returns numeric result as string Supports constants: pi, e

diagram

Generate Mermaid diagrams from descriptions.

ParameterTypeRequiredDescription
descriptionstringYesDescription of what the diagram should show
diagram_typestringNoType: flowchart, sequence, class, state, er, gantt
codestringNoDirect Mermaid code (if provided, description is ignored)

Returns Mermaid syntax that can be rendered by compatible viewers Validates Mermaid syntax when code is provided directly

file_watcher

Watch a file or directory for changes and report when a modification is detected.

ParameterTypeRequiredDescription
pathstringYesFile or directory path to watch
timeoutnumberNoSeconds to watch (default: 10, max: 60)

Uses inotify (FFI) when available, falls back to stat-based polling Returns change event details or “No changes detected” on timeout

repo_overview

Generate a structured overview of a repository including language detection, file counts, and directory structure.

ParameterTypeRequiredDescription
pathstringNoRepository path (default: workspace root)
depthnumberNoDirectory-tree depth

Desktop Environment Tools (Conditional)

Six desktop-environment tools register only when their backing binary is detected at startup:

ToolPermissionProbe (binary on PATH)Description
window_manageexecutebspcManage windows: list, focus, close, move, resize, desktops, layout, fullscreen
desktop_notifyexecutenotify-sendSend desktop notifications
display_layoutexecutexrandrGet or set display/monitor configuration
window_inforeadxwininfo or xpropGet window geometry, title, class, and properties
audio_controlexecutepactlControl audio via PulseAudio/PipeWire (sinks, volume, mute)
xrdb_querywritexrdbQuery or load the X11 resource database

window_manage

Manage windows via bspwm tiling window manager. Only available when bspwm is detected.

ParameterTypeRequiredDescription
actionstringYesAction: list, focus, close, move, resize, desktops, layout, fullscreen
node_idstringNoWindow/node ID (required for most actions)
targetstringNoTarget desktop name or direction
directionstringNoResize direction: left, right, top, bottom
pixelsnumberNoResize amount in pixels (default: 50)

Requires bspwm window manager Input sanitized to prevent shell injection

desktop_notify

Send desktop notifications via notify-send. Only available when libnotify is detected.

ParameterTypeRequiredDescription
titlestringYesNotification title (max 100 chars)
bodystringNoNotification body (max 200 chars)
urgencystringNoUrgency: low, normal, critical (default: normal)

Requires libnotify (notify-send) Input sanitized to prevent shell injection

display_layout

Get or set display configuration through xrandr. Lists connected monitors, changes resolution/rate, or arranges outputs.

ParameterTypeRequiredDescription
actionstringNolist (default), arrange, or resolution
monitorstringNoMonitor output name (required for arrange/resolution)
resolutionstringNoResolution, e.g. 1920x1080
positionstringNoArrangement, e.g. right-of DP-1 or an absolute position
ratenumberNoRefresh rate in Hz
primarybooleanNoSet the output as primary

Requires xrandr; execute-class.

window_info

Read detailed window geometry, title, WM_CLASS, and properties. Requires xwininfo and/or xprop.

ParameterTypeRequiredDescription
actionstringNoactive (default), id, or children
window_idstringNoWindow id (hex) for id/children

Read-class.

audio_control

Control audio through PulseAudio/PipeWire. Lists sinks/sources, sets volume, mutes or unmutes.

ParameterTypeRequiredDescription
actionstringYeslist_sinks, set_volume, mute, or unmute
sinkstringNoSink name or index (default: @DEFAULT_SINK@)
volumenumberNoVolume level 0–100

Requires pactl; execute-class.

xrdb_query

Query or load the X11 resource database.

ParameterTypeRequiredDescription
actionstringNoquery (default), get, or load
resourcestringNoResource name for get
filestringNoFile to load (path is workspace-gated)

Requires xrdb; write-class (mutates display state).

Computer Use Tools

Twelve computer-use tools register only when the display probe detects an X11/Wayland session (core.computer_use.detect_display_server) AND the per-tool required-binary census passes. On a headless host none register — the worker no longer advertises tools that can only fail. computer_use_force = true in the config re-registers the whole block for the remote-X posture; each handler then fails typed (no display server detected) on absent binaries, and the runtime refusal remains as defense-in-depth.

ToolProbe (X11 / Wayland)Permission
screenshotscrot / grimexecute
mouse_movexdotool / ydotoolexecute
mouse_clickxdotool / ydotoolexecute
mouse_dragxdotool / ydotoolexecute
type_textxdotool / wtypeexecute
press_keyxdotool / wtypeexecute
scrollxdotool / ydotoolexecute
get_cursorxdotool / — (unsupported on Wayland)read
display_infodisplay onlyread
window_listwmctrl / swaymsgread
clipboard_readxclip / wl-pasteread
clipboard_writexclip / wl-copywrite

screenshot

Capture the screen. Requires scrot (X11) or grim (Wayland).

ParameterTypeRequiredDescription
modestringNofull (default), region, or window
regionarrayNoCrop region [x, y, width, height] in pixels

Execute-class.

mouse_move

Move the pointer to the given screen coordinates. Requires xdotool or ydotool.

ParameterTypeRequiredDescription
xnumberYesX coordinate in pixels
ynumberYesY coordinate in pixels

mouse_click

Click at the current pointer position. Requires xdotool or ydotool.

ParameterTypeRequiredDescription
buttonstringNoleft (default), right, or middle
countnumberNoClick count (default 1; use 2 for double-click)

mouse_drag

Drag from one position to another (press, move, release). Requires xdotool or ydotool.

ParameterTypeRequiredDescription
start_xnumberYesStarting X coordinate
start_ynumberYesStarting Y coordinate
end_xnumberYesEnding X coordinate
end_ynumberYesEnding Y coordinate

type_text

Type text at the current cursor position. Requires xdotool or wtype.

ParameterTypeRequiredDescription
textstringYesText to type

press_key

Press a key or key combination. Requires xdotool or wtype.

ParameterTypeRequiredDescription
keysstringYesKey combination, e.g. ctrl+shift+a, Return, Escape

scroll

Scroll at the current pointer position. Requires xdotool or ydotool.

ParameterTypeRequiredDescription
directionstringNoup or down (default down)
amountnumberNoNumber of scroll steps (default 3)

get_cursor

Read the current pointer position. Requires xdotool; unsupported on Wayland.

ParameterTypeRequiredDescription
———No parameters

Read-class.

display_info

Read screen resolution and display information.

ParameterTypeRequiredDescription
———No parameters

Read-class.

window_list

List visible windows on the desktop. Requires wmctrl or swaymsg.

ParameterTypeRequiredDescription
———No parameters

Read-class.

clipboard_read

Read the current clipboard contents. Execute-class: the clipboard can carry passwords/OTPs from other applications, so consent is required. Requires xclip or wl-paste.

ParameterTypeRequiredDescription
———No parameters

clipboard_write

Write text to the system clipboard. Requires xclip or wl-copy.

ParameterTypeRequiredDescription
textstringYesText to write

Write-class.

Budget Limits

Control per-session spending with the --budget CLI flag:

luajit client/main.lua --budget <USD> --print "Analyze this codebase"

--budget <USD> — set a per-session USD budget session_budget_usd config key (default: 0 = unlimited) Agent loop checks accumulated cost after each provider call Returns {budget_exceeded: true} when cost exceeds budget Cost tracking uses per-model rate tables (see core/cost_tracker.lua)

Tool Auto-Discovery (S71)

Luna scans the workspace for custom tool definitions and makes them available to the agent alongside built-in tools.

Workspace scanning — Discovers tools from .luna/tools/ and ~/.luna/tools/ directories Hot-reload — Use /tools-reload slash command to rescan and pick up new tools without restarting Listing — Use /tools-list slash command to display all available tools (built-in + discovered) Namespacing — Custom tools are prefixed with custom__; MCP tools with mcp__; plugin tools with plugin__; built-in tools with builtin__

Tool Selection

The LLM agent selects tools based on the task. Common patterns:

TaskTools Used
Explore codebaseglob_search, grep_search, read_file, list_directory
Fix a bugread_file, bash (to reproduce), edit_file, undo_edit
Create a new filewrite_file
Refactor codeglob_search, read_file, edit_file, multi_edit
Run testsbash
Research onlineweb_search, web_fetch
Make API callshttp_request
Code navigationlsp (goToDefinition, findReferences, hover)
Track multi-step worktodo
Delegate subtasktask (sub-agent)
Team collaborationteam_mail (+ signed server-driven team directives)
Analyze imagesattach_image (with vision-capable model)
Undo file changesundo_edit, git_snapshot_restore
Work with notebooksnotebook
Generate diagramsdiagram
Quick mathcalculator
Watch for file changesfile_watcher
Ask the userclarify
Search past sessionssession_search, session_recent