# Tools (https://docs.neuralisapp.com/agent-core/tools)

agent-core ships its native tools as `tools/*.json` schemas under the
[schema-first tool contract](https://docs.neuralisapp.com/package-system/tools.md). They load through the
same discovery path as any package's tools and are dispatched through the same
policy, feature and approval gates — being built in grants no shortcuts. The
model receives every visible native tool's description **and full schema on
every step**, so those fields are operating instructions: selection, recovery
and safety boundaries, not procedures (those belong in skills). A connected MCP
server's tools are the exception: they load on demand through [`mcp`](#mcp).

| Tool | Purpose | Risk profile |
| --- | --- | --- |
| `execute` | Run a command on the app, a paired device or an executable source, or activate a skill; `background: true` detaches a shell that reports back | Destructive, open-world |
| `delegate` | Spawn a subagent with its own full agentic loop | Destructive, open-world |
| `workflow` | Create, change, run and read scheduled workflows | Write, feature-gated |
| `web_search` | Search the public web | Read-only, network |
| `web_fetch` | Fetch, render and optionally store a URL's content | Network; storing needs `files.write` |
| `ask_question` | Pause and ask the user explicit questions | Read-only, interactive |
| `connect` | List, add, check, authorize or disconnect MCP, channel, git, provider and source connections, or revoke your own MCP or git sign-in; secret and OAuth steps stay with a person | Write/open-world, per-kind feature-gated |
| `mcp` | Call a connected MCP server's tool that is loaded on demand, or list those tools' schemas; switched on, present while such a tool is available | The called tool's own gates |
| `todos` | Maintain the durable goal, loop and task list | Local state only |
| `compact_history` | Trim earlier context in place (remove / summarize / truncate) | Write, non-destructive and reversible |

Which tools an agent sees is narrowed per agent in the chat config's
[Tool Access](https://docs.neuralisapp.com/agent-core/app-surfaces.md#tool-access-per-agent-tool-selection)
panel, and per run by a `delegate` call or a workflow's `tools_off`. None of
these can widen past the package enable state or the caller's feature grants,
and a call to a tool outside the run's set is refused with the same neutral
`Tool not available` as a name that does not exist.

## Dispatch gates [#dispatch-gates]

Every tool call — native or package-contributed — passes the policy engine
first, in a fixed order, and each of these five arms can **deny** outright: the
global tool blocklist, the calling package's trust-tier ceiling, its capability
gate, the untrusted-package tool allowlist, and the feature gates from the
tool's declared `requires`. A tool blocklist or per-tool timeout declared by an
installed or dropped package is dropped at load — only a native package may
contribute to the cross-package arms — and a feature gate binds to the package
that declared the tool, so no package can gate a tool it does not own.

Only after all five pass does the conversation's guard profile (*safe*,
*balanced*, *auto*) decide whether the call runs or waits for approval — the
guard can never grant what an arm refused — and the per-tool timeout, bounded
by the package's trust tier, is resolved last. The guard never reads the call's
arguments, with one presence-based refinement that can only ever ADD a prompt:
a tool may list root input keys in `x-neuralis.askOnKeys`, and a call that sends
one of them asks in the asking profiles (read only from a declaration the host
stamped, so a remote MCP server cannot narrow the asking about its own tool; a
non-object payload asks). The input is then validated against
the schema and the `PreToolUse` hooks run; a hook that replaces the input has
the guard re-evaluated on what it substituted. An approval replays the
originally persisted input, so an approver is never shown different arguments
than the ones that run.

Any call that takes at least `perfSlowToolMs` (30 s by default) writes one
`perf.slow` warning with the tool's name, duration and outcome — never its
arguments or output — to the container log and the agent's run log.

## execute [#execute]

`execute` is the canonical execution substrate, with two actions.

### `action: "shell"` [#action-shell]

On the app or a device, it runs bash — pipes, redirects, chaining, git, python,
installed binaries. On a Windows machine it runs PowerShell instead (pwsh 7
when installed, else Windows PowerShell 5.1), and the result says
`shell: "powershell"`; its exit code is a native program's non-zero code, else
1 when the last command wrote an error (even one hidden by `-ErrorAction
SilentlyContinue`) and 0 when it did not. Key inputs: `command`, `cwd` (a source URI such as
`data://notes`, an absolute path, a path relative to the project data root, or
`${SKILL_DIR}` while a skill is active), `skill` (which active skill's
substitutions bind), `timeout` (10 min by default, at most 30), `env`, and a
one-sentence `reason` shown on the result card.

A shell opens in three steps on every plane: the **tool** (`core.execute`), the
**door** (the plane's entry feature — `server.shell` for the app, `device.own` or
`device.others` for a device, the source's declared id for an executable
source), then the **regulator** (the source's own path policy). A command then
meets these guards:

1. **Command analysis.** The command is parsed into an AST, bash-faithfully, so
   quoting and escapes cannot hide a name. Destructive system binaries
   (`mkfs`, `shutdown`, `sudo`, …), `eval` as a command, fork bombs, dangerous
   `rm -rf` forms and references to the platform zone or credential files are
   refused. A nested `bash -c "…"` is re-analysed rather than refused, up to
   four levels; a wrapper such as `timeout 5 …` or `env A=1 …` is judged as the
   command it runs. A PowerShell command is read lexically instead — the same
   credential and platform-zone strings, plus `sudo`, `runas` and
   `Start-Process -Verb RunAs` — and is never refused for being unparseable.
   This layer is defence in depth, not the boundary.
2. **The path policy.** The working directory must fall under a source whose
   [URI policy](https://docs.neuralisapp.com/package-system/uri-policies.md) grants `exec` on that directory
   (`exec` decides where a command starts, not which script it runs); every path the
   command touches needs `read`, or `write` for mutating commands and redirect
   targets. Uncovered paths deny by default; the allowances are `/dev/null`-style
   streams, `/tmp` reads, the active skill's directory (read and cwd only), and
   a private per-conversation, per-person scratch directory for `/tmp` writes. A
   command that cannot be parsed is denied, and if the gate cannot be built the
   call is a structured deny — never a passthrough. Every denial is audited.
   In a sandboxed shell on a Docker host whose sources do not nest inside each
   other, this layer checks only the working directory and the conversation's
   own raw files before the command starts; every other path is decided by the
   sandbox below, so a path the policy denies fails when the command runs, with
   `Permission denied` and a line naming the rule. That run-time refusal is not
   an audit row — the command itself is still logged.
3. **The OS sandbox.** A command is spawned inside a Linux **Landlock** sandbox
   whose roots are exactly what the policy grants (writable stays writable,
   read-only stays read-only) plus a read-only system baseline. That is what
   confines a path built at runtime — in a variable, a `$(…)`, or an
   interpreter — which no parser can see. Confined shells also cannot create
   Unix-domain sockets, so programs that need a local socket (syslog, an SSH
   agent, X11, D-Bus) do not work there; ordinary networking is unaffected. The
   sandbox **fails closed**: on a kernel without Landlock, a confined shell is
   refused, never run bare.
4. **Environment sanitization** (below).

`server.unconfined` bypasses the path policy and the sandbox **on the local plane
only** (admin tier). The power is intentional and unlimited; its safeguard is
the audit trail, which records every shell call a holder makes. It grants
nothing on a device or a remote source.

#### Environment sanitization [#environment-sanitization]

The child process environment is rebuilt, not inherited. Exact-name secrets
(database URLs, auth secrets) and any variable matching secret-like name
patterns — `*SECRET*`, `*TOKEN*`, `*PASSWORD*`, `*API_KEY*`, `*CREDENTIAL*`,
provider prefixes like `OPENAI_*` / `ANTHROPIC_*` / `GEMINI_*`, and more —
are stripped from both the base environment and caller-supplied overrides.

The only way through the filter is the **skill credential allow-list**: when
an active skill declares `credentials:` in its frontmatter, exactly those
keys, resolved from the [credential store](https://docs.neuralisapp.com/package-system/credentials.md) at
the caller's scope within the caller's tier ceiling (own user keys always;
agent and project keys with `project.credentials.write`; global keys with
`platform.scope` as well), are injected on the override side — and only for the
person who activated the skill, never for someone continuing the
conversation — except the reserved
connect-route ids (git / channel / MCP / workflow-signing), which are never
projected into a skill. The base environment
is still stripped, so a host-level secret with the same name cannot
piggyback on a skill's declaration.

Treat this as defence in depth: keep secrets in the credential store rather
than relying on a variable's name.

#### Stopping a command [#stopping-a-command]

The timeout is a deadline, not the only way a command ends. On the app plane,
stopping the turn terminates the command's whole process group — a polite
signal first, then a forced kill after a short grace — so a child process dies
with it. The result keeps the output captured so far and the card reads
*stopped*. A command running on a **device** stops the same way: the device is
sent a cancel and ends the whole process tree, and the result carries no
output. A device running an older CLI cannot cancel; there the command finishes
under its own timeout and the result says so — update the CLI and run
`neuralis device install` on that machine. On an executable source, Stop ends
the wait and ends the remote run itself only where the provider supports
cancellation; inspect state before retrying. A **background** shell is outside
all of this: it outlives the turn by design.

#### Where a command runs [#where-a-command-runs]

A command runs in the application container unless its working directory
resolves into a **folder on a device**; then it runs on that paired device.
The plane is decided by the owning source's stored configuration, never by a
name — an ordinary source called `host-notes` stays in the container — and a
bare absolute path resolves against the container first. A device's owner uses
it with `device.own`; anyone else needs `device.others` **and** a device running
sandboxed, and in every case the device must be paired and online. No role can
lift a device's OS confinement: the one exception is the device owner's own
start without the sandbox, on a pairing the owner approved on that machine
(below), and such a run has the command analysis and path policy as its only
checks. Commands are also clamped to the device owner's allowlist, and the
result reports the effective roots and confinement. The guarantees are under
[Host access](#host-access); pairing is on [devices](https://docs.neuralisapp.com/getting-started/devices.md).

#### Executable sources, including Webtop [#executable-sources-including-webtop]

An explicit `cwd: "<source>:///…"` selects that exact registered source; no
match, or a denied provider, never runs anywhere else. Each exec-capable
connector names its entry feature (Webtop's is `machine.control`), the platform
checks it, and the source's path policy then decides where a command may start.
Inside Webtop the container is its own boundary: the app sandbox does not apply
to what the command touches, and it receives no platform ticket, active-skill
credentials or substitution environment. It accepts the caller's `env` and
`background: true` where its desktop image supports them. Authenticated
external MCP clients can use this connector path without a stream; the app and
device shell, and skill activation, need an active stream.

### Background shells [#background-shells]

`execute({ command, background: true })` detaches a long-running command — a
build, a test run, a server — and returns a `shellId` plus `statusUri` and
`outputUri` at once. It runs under the **same** guards; background adds no
bypass. When it exits (or is stopped, or lost to a restart), the platform
continues the conversation with a **background report** card carrying the exit
code and a bounded head and tail of the output — a result the platform writes
and the model cannot make. The agent dispatches and ends its turn; there is
nothing to poll. The report runs as the person who started the shell, with
their rights re-resolved, never while an approval is open and never over a turn
in flight — live in their browser when the conversation is open, on the server
otherwise.

The card and the chat's Shell tab show live output; the full log is readable
with `fs_read(outputUri)`. Listing, reading more and stopping are routes, not
tools — the card's **Kill** and the `execute-skill` scripts — and reach only
shells you started; only the agent that started a shell can stop it. On a
device, background runs work when the device's ceiling names a lifetime limit,
and survive an application rebuild. Long jobs belong here, never in a
hand-rolled `nohup … &`, which has no record, no report and no Kill. The switch
and budgets are [platform settings](https://docs.neuralisapp.com/agent-core/config-settings.md).

### Live output and the result the model reads [#live-output-and-the-result-the-model-reads]

These are two channels, and only the second reaches the model. Live output
streams to the card as the command runs, paced and capped so a chatty command
cannot flood the browser. When it ends, the card switches to the captured
result — the value the model receives, under the same cap. The limits (live
frame pacing and caps, the captured output per run, the background ring, and
the tool-result cap every tool meets) are admin settings; whenever one trims
something the card says so, keeping the **most recent** lines.

### `action: "skill"` [#action-skill]

Activates a `SKILL.md` bundle by name: the body is rendered into context with
`${SKILL_DIR}`, `${SKILL_URI}`, `${SESSION_ID}` and `${NEURALIS_API}`
substituted, and the skill's declared credentials are resolved and staged for
later app and device shell calls — the model never sees the values. Scripts run
with `cwd: "${SKILL_DIR}"`, so [agentskills.io](https://agentskills.io) bundles
written as `bash scripts/foo.sh` work unchanged (on a Windows device a bash script needs Git for Windows). For a connector-backed skill,
use the directory URI from activation and a relative script command. See
[skills](https://docs.neuralisapp.com/agent-core/skills.md) and [package-system skills](https://docs.neuralisapp.com/package-system/skills.md).

## Host access [#host-access]

A **paired device** — the server itself, or a member's own machine — lets a
command or a terminal tab run there instead of in the container. Pairing,
folder grants and the sandbox are described from the device owner's side on
[devices](https://docs.neuralisapp.com/getting-started/devices.md); this section is the contract the platform
holds to. The plane ships **off** and has **no per-role bypass, not even for an
owner**. The `Devices: Kill-Switch` setting is necessary but never sufficient:
on, every guarantee below must still hold; off, every device stops at once.

The device runs a small **broker** started by the device client. It dials
**out** to the application over an authenticated WebSocket (`wss://`, or `ws://`
to a loopback address only); the container mounts nothing from the device, holds
no host secret, and nothing from the device is ever a request. Every one of
these holds before a command runs:

1. **Pairing happens on the machine.** A device exists only after a person ran
   the device client there and signed in once, or after the offline upgrade
   registered the server's own broker. No in-app role can create a device, its
   service or its allowlist.
2. **Authentication.** The link presents the device's secret; the application
   keeps only a hash, compared in constant time, and a wrong, unknown or revoked
   device gets the same refusal. A pairing is bound to its owner's sessions:
   after they are reset, the device pairs again. The device's only
   unauthenticated endpoint reports bounded health, never a path, secret or
   allowlist.
3. **The device's allowlist.** Every command resolves to *requested ∩
   allowed*, and the intersection never widens. An empty, missing or malformed
   allowlist denies everything — "not configured" never means "unlimited". The
   owner's own commands may also read, never write, the Neuralis packages
   installed on that machine, so a built-in skill's scripts run there.
4. **Filesystem confinement.** Every host command and host terminal runs in the
   OS sandbox with the clamped roots. A sandbox helper that is missing or fails
   its self-test means the request is **denied** — there is never a bare spawn on
   a sandboxed device. On a sandboxed device the owner's own Git fetch and push
   from the Git panel run outside the sandbox, so their credential helpers work —
   only that fixed Git command, only with helpers their own Git configuration
   names.
5. **Socket isolation.** A confined command cannot create a Unix-domain socket,
   abstract sockets included, so it cannot reach a host control socket; the
   filter also refuses the alternate system-call numbering that would walk around
   it. The helper proves this about itself when the image is built and again at
   startup, and the broker **refuses to serve** if any host control endpoint is
   still reachable. Programs that need a local socket (syslog, an SSH agent,
   X11, D-Bus) do not work in a confined host command; ordinary networking is
   unaffected. A device that runs other people's commands should run its broker
   under a dedicated service account with no groups and no login session — a
   process cannot shed what it inherited.

**Starting without the sandbox.** One rule holds on every machine: a command
starts in the sandbox. The one exception is the device owner's own foreground
command or terminal, from a pairing the owner approved on that machine
(`neuralis device grant --unconfined --device <id>` or the pairing's own
question; `--revoke` takes it back),
— in chat only when the owner switches that machine's sandbox off under "Your machines" in the composer's guard-profile chip, in a
terminal by default unless the owner picks Sandboxed. Such a run says `unconfined`, runs bare as
that account (root-equivalent on that machine), and the roots it reports were
computed, not enforced. Background runs, MCP servers and another member's
commands always start sandboxed. There is no machine-wide unsandboxed mode.

**Who may use a device.** Its owner, through `device.own`, whatever its
confinement. Anyone else needs `device.others` (commands and tabs alike)
**and** the device must currently be sandboxed — and every case needs a
paired, online device. `server.unconfined` grants nothing here. Attaching or
editing a source on a device is the owner's alone; a non-owner is refused like
an unknown device, and every root on a device — a subfolder as much as `/` — is
gated that way, because widening a permission is an escalation. A folder on a
device is never a container terminal tab, and there is no aggregate host-root
tab.

**Background runs** work on a device when its allowlist names a lifetime limit
(`maxDetachedLifetimeMs`); otherwise the refusal says so. They survive an
application rebuild — the broker keeps the process and the platform re-attaches
— and end with the broker (`lost`) or at the limit (`killed`).

**Seeing devices.** One route serves every view (Admin Devices tab, the Files
source form, the terminal picker, `neuralis device list`, `manage-devices`). Your
own devices list in full. Another member's device appears in a project only when
it carries a source you can see there, and then only with its owner, name,
online state, confinement and those sources — never its platform, version,
last-seen time or the reason it is unavailable; listing every device needs
`platform.users`. After a stop, a restart or a transient fault the device
redials on its own, backing off from one second to one minute; a revoke, a
disabled owner, a sessions reset or another process taking over its link ends it
for good. Online, offline, revoked and renamed reach open clients as a device id
and a state — only to the owner, a `platform.users` holder, or a member who sees
one of its sources there. A device counts as offline after a 15 s grace, and the
right to these signals is re-checked every few seconds
([events](https://docs.neuralisapp.com/agent-core/events.md)).

**Installed programs.** An agent can ask which programs each machine it could
run a shell on has installed (the `environments/programs` route `workspace-overview` teaches): only the
container and the online devices open to that caller, recognised from metadata
alone — names, package versions, whether a sandboxed shell reaches them —
without running anything or returning a path. A synced skill that declares the
programs it needs gets one line at activation pointing to that check; it hides
no skill.

**Platforms.** A Linux device (x64 or arm64, WSL2 included) runs sandboxed with
the helper the client ships. macOS uses Seatbelt (implemented, not yet proven on
Mac hardware) and Windows 11 (build 26100.9278 or later, x64) Microsoft's
process containers (proven on one Windows 11 machine). A device installs sandboxed only after its OS
sandbox passes a probe on that machine; otherwise the install says why
the probe failed, and the device serves its owner alone: only the owner's own commands
and terminals start there, without the sandbox, from a pairing the owner
approved; everyone else's are refused with `sandbox_unproven`. Members' shells on
a desktop host run under the same sandbox once the host proved it, and are
refused until then. On Windows, commands run in PowerShell; a terminal tab picks
one of the machine's own shells (PowerShell, Command Prompt, Git Bash, each WSL
distribution — the last two only without the sandbox); a network or WSL folder (`\\…`) cannot be
a sandboxed command's working directory — pair WSL as its own Linux device. Files on a device are
read, scanned and indexed like any source, but executable source packages are
never loaded across the broker — only from the server's own disk.

## delegate [#delegate]

`delegate` spawns a child agent runtime with its own complete loop and returns
its final answer to the parent.

- `task` (required), optional `context` placed ahead of it, and optional
  `agent` (default `general`) and `model`.
- `tools` / `blocked_tools` narrow the parent's catalog and are enforced when
  the child **calls**, not only in what it is shown. An empty `tools: []` is
  rejected — omit it to inherit. Every name in `tools` is answered: the ones
  that do not survive are named back (not in the catalog, barred from
  subagents, outside the agent's own ceiling, or blocked by the call), and a
  list of which nothing survives is refused.
- `disabled_packages` removes packages for the run and unions with the parent's
  set — a subagent can only narrow.
- `timeout_ms` (5 min–3 h, default 2 h) and `max_steps` (default 1000, max
  2000) end in one text-only wrap-up turn rather than an empty result; a cut
  run is reported as *partial*, with a first line saying so.

The reply is the child's **last substantive turn**. Past the platform's answer
cap it is clipped keeping both ends, with a marker naming where the full
transcript lives. Every run is persisted under the parent conversation and
opens read-only from the chat's Delegates tab.

A child **inherits the conversation's guard profile** — it is not a tool input,
so the model cannot lower its own guard. Under *safe* or *balanced*, an inner
tool that needs approval pauses the child; the delegate card turns into that
tool's card with Approve / Deny, and the child resumes where it stopped,
durably. Under *auto* it never pauses. How agent definitions shape a run is on
[agents](https://docs.neuralisapp.com/agent-core/agents.md).

### Background runs [#background-runs]

`background: true` returns a run id with `statusUri` and `transcriptUri` at
once, and the subagent keeps working while the agent replies. Detaching is
top-level only: a subagent's own delegations run in the foreground, and the tool
result says so. When the run finishes, its answer arrives as a **result card**
and the conversation continues by itself, as the person who started the run
with their rights re-resolved — never interrupting a response or an open
approval, queued rather than dropped. Stopping a run, or continuing a finished
one with a further instruction, are routes the `delegate-skill` scripts call.

A background run keeps the guard profile it started with, adopts a **stricter**
one if you switch meanwhile, and never a looser one; whatever the call narrowed
stays narrowed for its whole life. A run that parks on an approval holds
nothing open: you answer in the Delegates tab and it continues. Under *safe* or
*balanced* the dispatch itself needs one approval first. A stopped run reports
as *stopped*, a failed one leads with **why**, and either way it leaves no open
question behind. A graceful platform restart does not end a subagent's work: a
running background or awaited foreground subagent continues from its own
transcript once the platform is back, up to a set number of restarts in a row.

## workflow [#workflow]

Creates, changes, runs and reads the project's workflows. Its keys are four
verbs, applied in the order `set` → `run` → `get` → `list`. `set` without a
`workflow_id` creates one (title and instruction required; active unless you
ask for a draft); with one, it changes only what you send — schedule, first
webhook and its body contract, model, goal and loop, packages and tools
switched off (`tools_off`, narrow-only), runtime limit, status and delivery.
Every verb is checked before anything is written; when one succeeds and another
is refused, the call names the refusal. `run` and `get` with a `run_id` accept a
bounded `wait_seconds`. The rarer operations — templates, archive and restore,
bindings, cancellation, extra webhooks, revoking a key — are the
`manage-workflows` scripts. The tool never issues a key: a secret in a tool
result would stay in the conversation. It requires `workflow.read` and
escalates to `workflow.write` (`set`) and `workflow.dispatch` (`run`). See
[workflows](https://docs.neuralisapp.com/agent-core/workflows.md).

## Web tools [#web-tools]

Both need `core.web` and share one hardened fetch path: DNS-pinned requests,
private-address and redirect validation, and per-call host allow-lists, so the
model cannot reach internal addresses.

- **`web_search`** — `provider` picks the strategy: `auto` (the default; walks
  the administrator's order and fuses results), `native` (the search built into
  the model you run on), or one of `tavily` / `brave` / `searxng`. Every
  strategy falls back to a keyless engine, an unconfigured provider is skipped,
  and the result says why when a weaker engine answered. Each result carries
  `title`, `url`, `snippet` and a `publishedAt` day (or `unknown`). Native
  search is metered on the conversation's model — its tokens and the vendor's
  per-search fee count towards usage and spend limits — and is skipped, never
  redirected, on a model whose vendor offers none. `time_range` (`day` …
  `year`) and `allow_domains` / `block_domains` are passed to the providers that
  support them and enforced again on the way back; a provider that cannot
  apply one says so. `mode: "research"` adds query variants, freshness and
  authority ranking and optional full-page Markdown, with an administrator cap
  on paid variants.
- **`web_fetch`** — one URL's readable content, up to `max_chars`: HTML,
  Markdown, JSON, XML, plain text and PDF (a PDF over its own size ceiling fails
  with a message naming the limit). `format` is `markdown`, `text`, `raw` or
  `json`; a page that only renders in a browser is reported as such.
  `timeout_ms` bounds the network phase. `save_to` (`tmp`, or a `data://` path)
  stores the whole rendering, not clipped to `max_chars` and bounded by the
  fetch byte cap, and also needs `files.write` — `tmp` needs `core.execute`
  too.

## connect [#connect]

The common control plane for MCP servers, channels, git remotes, provider
credentials and brain sources. A call may combine `remove`, `add`, `check`,
`authorize` and `list`; every input and required feature is checked before any
write, then applied in that order, and a later refusal keeps what already
landed and names itself. Each kind keeps its own grant (`mcp.connect`,
`channels.connect`, `git.connect`, `credentials.self`, or the source grants)
and its own route. `list` answers per kind, so one refused kind never empties
the result. Results are secret-free projections: secret values, creator ids,
source paths and raw config never enter the model result. Provider, git and
channel setup return a secure hand-off for a person, and an OAuth URL is for
the person to open, never the model.

## mcp [#mcp]

A connected MCP server's tools load **on demand** by default: the agent's
`<packages>` block names every tool it can call under that server (up to a
structural cap; the rest are reached through `mcp list`), and the
schemas stay out of the per-request tool list, so a server with dozens of
tools costs a line per tool instead of a schema per tool on every step.
`mcp {call: {server, tool, arguments}}` runs one directly; `mcp {list: {server}}`
or `{list: {tools: [...]}}` returns full schemas first — whole, never cut; what
does not fit in one answer is named for a later call. A tool pinned **direct**
(per tool in Tool Access, or a whole server on its MCP servers row) goes in the
tool list with its schema instead. When two servers expose the same tool name,
the tool list can carry only one of them; `mcp {call: {server, tool}}` reaches
either, and each is listed under its own server. `mcp` itself is switched in Tool Access like
any tool: switched off — or left out of a custom tool list — nothing loads on
demand and every enabled server tool goes in the tool list with its schema.

Calling through `mcp` changes nothing about the gates: policy, the approval
prompt, input validation, hooks, timeouts, result bounding and the audit trail
all act on the tool actually called, under its own name. A name that is not a
tool of the named server available to this agent — switched off, hidden, a
package or built-in tool, or simply unknown — gets one identical refusal. A
`delegate` child receives `mcp` only together with a tool it reaches, and
blocking `mcp` blocks every call through it. `mcp` is never offered to
external MCP clients.

## Interaction and context tools [#interaction-and-context-tools]

- **`ask_question`** — asks one or more explicit questions (with options and
  multi-select) and blocks until answered. **Subagents never receive it**: a
  subagent has no path to a person.
- **`todos`** — `plan` sets one locked goal per cycle with checkable
  done-conditions, a loop bound (`until`, an enforced `maxSteps` that can only
  be lowered) and todo steps; `mark` updates steps and marks conditions met by
  number or exact text; `close` ends the cycle (`achieved`, or `cleared` for a
  goal the agent set itself). Meeting the last condition archives the goal and
  its list as a versioned entry and empties both. A goal set by the user or a
  workflow is locked to the agent — it can achieve it, never drop it — except in
  a run authored as self-evolving. The state persists with the conversation,
  survives restarts, is shared in a multi-user conversation, and is always
  visible in the `<session>` block. The composer's **Goal & loop** dialog offers
  the same **Achieve** / **Clear**.
- **`compact_history`** — an in-place, **reversible** trim of earlier context:
  reference a tool output by its `tool_use_id` (or a non-tool row by sequence
  number) and `remove`, `summarize` or `truncate` it. The conversation is never
  forked or rewritten; the trim is re-applied each turn and a reader can toggle
  it off (**Show full**). Use it when a large low-value output or a finished
  phase competes with the goal; `/summarize` condenses the whole conversation
  instead.

## Multimodal results [#multimodal-results]

Tools that return images, audio or other media surface them as real content
blocks to a model that accepts the modality, and a clear marker otherwise. The
media is persisted with the conversation, so a reload or a resumed turn sees the
same pixels. Media from a file with a stable address is stored as a reference
and re-read under your own access on reload; a source you lost access to
degrades to a "no longer available" marker. Attachments added with a
`⟦fs:read:…⟧` reference follow the same rule.