Agent Tools
The nao agent uses built-in tools autonomously to answer user requests.execute_sql
execute_sql
Execute SQL against connected databases and return structured results.
- Supports multiple database connections.
- Returns typed columns and row counts.
- Outputs can be reused by other tools.
- Pass
duckdb_localas the database to use nao’s own DuckDB engine instead of a warehouse: it queries CSV, JSON, Parquet, and Excel files by path, and joins them against earlier query results. See Files and Storage. save_towrites the result to a CSV or Parquet file in permanent storage, on top of returning the rows.
display_chart
display_chart
Create charts from SQL results.Supported chart types:
- Bar charts
- Stacked bar charts
- Line charts
- Pie charts
- KPI cards
execute_sandboxed_code
execute_sandboxed_code
Execute code in an isolated sandbox (micro-VM) for advanced analysis.
- Supports Python and shell execution.
- Can install Python packages for a run.
- Can reuse prior SQL outputs as CSV inputs.
- Images uploaded to the chat are mounted into the sandbox, so the agent can read or manipulate them directly from Python (e.g. OCR, cropping, chart comparison).
- Files in permanent storage are mounted the same way through
storage_files, for formats the other tools cannot parse. - Requires enabling Sandboxes in the Experimental card under Settings -> Agent -> Capabilities.
- When you run nao locally, the sandbox runtime (around 100 MB) is not shipped in
nao-core: nao downloads it on first use and caches it under~/.nao/native. Runnao chat --sandboxto pull it ahead of time, and setNAO_NATIVE_REGISTRYto fetch it from an npm mirror instead ofregistry.npmjs.org. The DuckDB engine used bynao testis downloaded the same way.
codemode
codemode
Run a short JavaScript script in an isolated sandbox, to combine several MCP tool calls in a single step.
- Experimental. On by default: an admin can turn it off with the Code mode toggle in the Experimental card under Settings -> Agent -> Capabilities.
- MCP tools are called as
await mcp.<server>.<tool>(args)(for examplemcp.linear.get_ticket({ id: "ENG-1" })). The agent can chain calls, run independent ones in parallel, loop over results and filter them in one script. Only what the script logs or returns reaches the conversation, not the intermediate results. - Calls go through the same path as
mcp_call: argument validation, tools disabled by an admin, User Group restrictions and per-user OAuth still apply. A call to a server the user has not connected shows the usual Connect button. - Without MCP servers, it is still available for plain computation on data the agent already has.
- The sandbox has no network, file system or modules. A script runs for at most 2 minutes with 128 MB of memory, and makes at most 500 MCP calls, 10 at a time. MCP calls are real: their side effects are not undone if the script fails afterwards.
- In chat, the tool call shows the script, its logs, its result, and each MCP call with its status and duration.
write
write
Save a file to permanent storage, under the user’s
/home folder./homeis the only writable place in the file tree; project context is read-only.- Used for exports, spreadsheets the agent builds, and intermediate results worth reusing.
- Unavailable when the deployment sets
NAO_STORAGE_BACKEND=none. See Files and Storage.
search
search
Search files with glob patterns in your context.
list
list
List files and directories so the agent can navigate project structure.
read
read
Read context files such as SQL models, docs, and rule files.
grep
grep
Search text patterns across context files with regex.
web_search / web_fetch
web_search / web_fetch
Search the public web with your model provider tools and fetch cited pages when needed.
- Uses provider-native capabilities (OpenAI, Anthropic, Google) when enabled.
- Lets the agent answer questions that need fresh external information.
- Sources are shown in tool call output for traceability.
clarification
clarification
Ask the user a focused question when their request is genuinely ambiguous (multiple plausible tables, unclear metric, missing time range, etc.).
- Renders a “Quick question” card with the question and up to 5 clickable answer chips.
- Clicking a chip sends the answer directly - no extra Enter press required.
- Free-form answers via the normal chat input are also supported.
- The agent pauses and waits for the user’s reply before continuing.
- Multi-turn clarification works naturally: previous cards switch to an “Answered” state with a checkmark on the selected chip so the full decision trail stays visible.
task (subagents)
task (subagents)
Delegate a self-contained task to a subagent that runs its own tool loop with a fresh context and returns a single report, so the work does not fill the main conversation’s context window.
- Beta. Enabled by default on nao Cloud. On self-hosted deployments it is off by default: enable it with
BETA_SUBAGENTS_ENABLED=true. - One subagent type today: Explore. It finds the context a question needs (tables, columns, joins, metric definitions, docs, rules) using only
list,search,grep, andread, in at most 15 steps. It never queries a database or answers the question itself. - The agent delegates when the relevant context is not yet known and finding it would take more than a couple of lookups. Each task states a thoroughness level: quick, medium (the default), or very thorough.
- The subagent returns a markdown report with Relevant files, Findings (exact table and column names, join keys, filters, metric definitions), and Not found (what the context does not cover, a useful signal for context gaps).
- In chat, the task shows inline with its steps and a live duration. Open it to see the full subagent conversation and report. Admins get the same view when replaying a chat from Settings -> Usage & Costs.
- Subagents run on the chat’s model unless an admin pins one in the Subagent model card under Settings -> Agent (see Agent Settings). A model the user explicitly asks for in the chat takes precedence over both.
- Subagent runs count toward budgets and usage like any other LLM call.
MCPs
MCP (Model Context Protocol) servers expose external tools that the agent can call next to built-in tools. Configure MCP servers inagent/mcps/mcp.json:
${VAR} placeholders anywhere in agent/mcps/mcp.json to inject values at load time. nao resolves them from the project environment variables first, falling back to the process environment. Any placeholder found in mcp.json also shows up in the Environment Variables card under Settings -> Project Settings alongside the ones from nao_config.yaml, so you can set MCP credentials there without editing the file, and the servers pick up the change on the next refresh.
Each variable in the card shows where its value comes from. Values are never sent to the UI.
- (set from environment) - no project value is stored, and the variable is set in the server’s process environment. The field is read-only.
- (configured) - a project value is stored. The field stays editable for admins, and the stored value overrides the process environment.
- (not set) - no value anywhere yet.
Remote HTTP servers
Alongside localcommand servers, you can connect to remote MCP servers over HTTP. Set transport to streamable-http and point url at the server endpoint:
streamable-http, sse, and http. Servers declared with a command run over stdio.
In cloud mode (
NAO_MODE=cloud), only HTTP transports are allowed. Command-based (stdio) servers are not started: nao refuses to register them during discovery, mcp_call, and user connect, and the agent is not told about them. Blocked servers still appear on the MCP Servers settings page, flagged with an explanatory error and no tools, so admins can see them and switch the server to an HTTP transport. Self-hosted deployments run every transport unchanged.How nao loads MCP tools
nao does not hold a live client connection to each server, and it never loads every tool definition into the context window. Instead:- nao connects to the server once and reads its tool list.
- It writes one OpenAPI JSON file per enabled tool into the context filesystem, at
agent/mcps/<server>/<tool>.json. The file name is the tool name. - The agent discovers what it needs on demand with the normal
list,read, andgreptools, then invokes it through a singlemcp_calltool.
mcp_call takes the server name, the tool to run (the operation’s operationId), and an arguments object matching that operation’s request body schema. Arguments are validated against the schema before the call runs, so a malformed call comes back as a validation error listing the specific issues rather than failing at the server.
The generated spec directories are gitignored - they are discovered at runtime and do not need to be committed.
Inline authentication
When a remote server requires OAuth, nao prompts the user to sign in inline the first time its tools are needed, so each user authenticates with their own account instead of sharing one organization-wide login. The connection is authorized per user and reused on later runs. If the agent calls a tool on a server the user has not connected yet, the call returns an auth-required result and a Connect button is shown below the conversation. The agent stops and waits instead of retrying.Pre-registered OAuth clients
Some providers (for example GitHub or Meta Ads) reject Dynamic Client Registration. For these, register an OAuth app with the provider and declare its client inagent/mcps/mcp.json under oauth. nao uses it in an authorization code flow with PKCE. clientSecret is optional.
<your nao URL>/api/mcp-oauth/callback as the redirect URI in the provider’s OAuth app. ${VAR} placeholders work as everywhere else in the file. If a variable is missing, connecting fails with MCP server "<name>" needs <VAR> to be set. Add it in Settings > Environment variables or in the server environment.
When sign-in fails, the provider’s error is shown in the popup (which stays open), under the chat Connect prompt, and under the Connect your account button on the MCP servers settings page.
Managing servers and tools
Admins manage MCP servers from Settings -> Agent -> MCP servers. The table lists each server declared inagent/mcps/mcp.json with its transport, connection status, the number of enabled tools out of the total, and a toggle to enable or disable the whole server. Servers that use OAuth carry an OAuth badge, and users who have not signed in yet get a Connect your account button.
Connect all MCP servers re-runs discovery across every server, and each row has its own refresh action to reconnect a single server. Each server shows one status:
- Connected - the last connection test succeeded.
- OAuth working - an OAuth server the current user is signed in to.
- Sign-in required - an OAuth server the current user has not connected yet.
- Cached - discovered previously, not re-tested.
- Error - the connection failed. The error is shown on the row.
- Not tested - not discovered yet.
Skills
Skills are reusable workflows defined as markdown files inagent/skills/.
A file is recognized as a skill only if:
- It is stored in
agent/skills/. - It starts with YAML frontmatter including
nameanddescription.
/ shortcuts or natural prompts that match skill descriptions.
Admins can limit which skills each User Group can use, and preload skills so their full content is added to every chat for that group.
Personal skills
A personal skill is a skill only its author can see and use. It is stored in nao, not in the context files, so writing one needs no Git access or review.- Create one from the last entry of the
/menu, Create a skill, or from Context Hub -> Skills. The dialog asks for a name, when nao should use it, and the instructions. Admins and context admins can pick a personal or a team skill in the same dialog; the team option writesagent/skills/<name>.mdinto their changes. - Use it like a project skill: with
/or by asking something that matches its description. In the/menu, personal skills come after the project ones, with a teal/. - A project skill always wins over a personal one with the same name, and a personal skill cannot take the name of an existing project skill.
- Manage them in Context Hub -> Skills: All skills lists the skills shared with everyone and yours, Mine lets you edit, delete, or Request to share a personal skill.
- Share requests lists the personal skills people asked to share with everyone. Admins and context admins can accept one, which adds it as
agent/skills/<name>.mdto their changes to publish, or decline it, which tells the author. - The context editing chat in the Context Hub can also edit your personal skills, request to share them, and accept or decline share requests.
- Create one from a chat: ask the agent to save what it just did as a skill (“save how you did this as a skill”). The agent can create and list your personal skills through nao’s internal MCP server (
nao__internal), which it discovers like the project’s MCP servers, so these tools are not added to every run. The namenao__internalis reserved: anmcp.jsonthat declares it is rejected. - Create a skill in the chat’s + menu opens the new-skill dialog. Users with the Context Hub editor can click Open in editor to save the draft and keep writing it with the Context Hub chat; instructions can be left empty until you save from the editor.
list_personal_skills and create_personal_skill.
To add a Skills entry to the sidebar, turn it on in Settings -> Appearance -> Menu. It is hidden by default.
