Tools

orangu exposes local workspace tools to the active model.

Tools are sent as OpenAI tools on every chat request, and the model asks for one by answering with tool_calls; orangu runs it in the workspace, feeds the result back as a tool message, and lets the model continue. max_tool_rounds in [orangu] bounds how many such rounds one prompt may take.

Whether this works depends on the model, not on orangu: a model whose chat template has no tool support never sees the declarations and will say it has no tools available. orangu-server passes the array through to the template and translates the answer back — see Tool calling in the Inference server chapter for which answer formats it recognises.

Configured Streamable HTTP MCP servers can add tools to this list. Their names are namespaced as mcp__<server>__<tool> so they cannot collide with built-in tools or another server. orangu discovers them once when a workspace opens; a server that cannot be reached is disabled with a warning while built-in and other MCP tools remain available. MCP tool results are returned through the same text tool result channel as built-in tools and are capped at 20,000 characters.

MCP support currently exposes tools only. Resources and prompts are not exposed; /mcp refresh re-discovers tools at runtime.

Available tools

Tool Purpose Key arguments
show_file Show a text file from the workspace path, optional start_line, optional end_line, optional mode
create_file Create a file with content, optionally with its permissions path, optional content, mode, overwrite, parents, git
modify_file Modify a file, by text replacement or by line ranges path, either old_text/new_text (+ replace_all) or edits, optional git
move_file Move or rename a file from, to, optional mode, overwrite, parents, git
delete_file Delete a file path, optional git
create_directory Create one directory path, optional mode, parents
move_directory Move a directory and everything under it from, to, optional mode, parents
delete_directory Delete an empty directory path
list_directory List files and directories below the workspace optional path, optional max_depth
fetch_url Fetch an external URL and return readable text url, optional max_chars
run_shell_command Run a shell command inside the workspace command, optional cwd, optional timeout_seconds
expand_context Retrieve previously compressed/truncated output using its hash ID id

The eight file-lifecycle tools are the same operations orangu-server serves over HTTP as /v1/create_file, /v1/modify_file and so on — one shared implementation (orangu::files), so a tool call, a typed command and an API request behave identically. Their full field-by-field schemas are in the HTTP endpoints chapter, under File-lifecycle API.

They replace the earlier read_file and edit_file: read_file is now show_file with the same arguments, and edit_file is now modify_file, which still takes old_text/new_text and additionally accepts the server’s edits line ranges. The typed /add_file is obsolete for the same reason — it was /create_file without content (see the Git commands chapter). An existing path is overwritten on every surface — tool, typed command and HTTP endpoint alike; pass "overwrite": false for create-if-absent.

Licence headers. A file that create_file brings into existence is generated code, and it is written with the workspace’s own licence at the top of it, as a comment in that file’s own language — // for Rust and the C family, # for shells and configuration formats, -- for SQL and Lua, ;; for Lisps, % for TeX and Erlang, REM for batch files, and a delimited <!-- -->, /* */ or (* *) block for a language with no line comment. A shebang or an XML declaration keeps the first line; the licence goes directly beneath it.

The licence and the copyright holder are read from the workspace: the license field of its Cargo.toml, pyproject.toml or package.json, or failing that its LICENSE/COPYING file — used verbatim when it is a licence orangu has no header for. A project that says nothing gets MIT. /license overrides all of it for the session, including turning headers off; see the Core tools chapter.

Three things never get one, and they are the point of the rule:

Because the header is added on top of what was sent, the file on disk has more lines than the content argument did. The tool result reports this as "licensed": true, and a modify_file that names line numbers should read the file back first. "licensed": false means no header was added — which, now that the licence is the project’s, is the ordinary answer in a project that does not declare one. The licence texts are strings compiled into the binary rather than files read from disk, and they are shared with the web console’s code blocks, which use the same implementation.

Git. In a Git repository these tools make their change with the Git command — create_file/modify_file stage with git add, move_file moves with git mv, delete_file deletes with git rm — so work is staged as it happens. Nothing is ever committed; that stays your decision (/commit). Pass "git": false on a call for a plain filesystem change.

Workspace restrictions

The tools are rooted in the active workspace. By default this is the current directory, unless orangu was started with --workspace /path/to/project.

Paths that attempt to escape the workspace are rejected.

Absolute paths are allowed only when they still resolve inside the workspace after normalization.

show_file

show_file returns text content with line numbers:

{
  "path": "src/main.rs",
  "start_line": 10,
  "end_line": 20,
  "mode": "full"
}

Behavior:

modify_file

modify_file performs a targeted replacement inside a workspace file:

{
  "path": "src/main.rs",
  "old_text": "fn old_name()",
  "new_text": "fn new_name()"
}

Optional flags:

Important details:

list_directory

list_directory is a workspace-scoped directory listing tool:

{
  "path": "src",
  "max_depth": 3
}

Behavior:

fetch_url

fetch_url retrieves external documentation or reference material:

{
  "url": "https://example.com/docs",
  "max_chars": 12000
}

Behavior:

expand_context

expand_context retrieves exact session-cached context that orangu kept outside the prompt to save tokens. Most truncation markers point directly to the complete original blob; bounded workflows such as /create_patch may instead point to a small index whose entries can be expanded selectively.

{
  "id": "abc1234567"
}

Behavior:

run_shell_command

run_shell_command executes a Bash command inside the workspace:

{
  "command": "cargo test --quiet",
  "cwd": "crates/core",
  "timeout_seconds": 60
}

Behavior: