API reference
Every keyword, every field it accepts, the allowed values, and the defaults.
This is the full reference for the .nt format. It lists every keyword (block),
every field you can set on it, the values each field accepts, and the default
when you leave it out.
How to read this
Each keyword has its own table. Field is the exact name you write. Type is what kind of value it takes. Values / default shows the allowed values, or the default used when you skip the field.
Field types
input, output, and a tool's input are maps of fields. Each field is either
a bare type or an object with more detail.
input:
clues: string # short form
output:
age:
type: number # full form
description: The best guess.
required: false # optional; defaults to true| Type | Meaning |
|---|---|
string | Text. |
number | A number. |
boolean | true or false. |
object | A nested structure. |
array | A list of strings. |
| Field option | Type | Values / default |
|---|---|---|
type | string | One of the types above. |
description | string | Optional note about the field. |
required | boolean | true (default) or false. |
Thinking levels
Several places accept a thinking level. From least to most effort:
| Value | |
|---|---|
off | No extended thinking. |
minimal | |
low | |
medium | The default. |
high | |
xhigh | |
max | The most thinking. |
config
Project-wide settings. One config block per project.
| Field | Type | Values / default |
|---|---|---|
target | string | Defaults to node. |
entry | string | The agent or workflow nt up runs. No default. |
audit | string | off, or the folder tool calls are logged to. Defaults to ~/.nt/audit. |
show_tool_calls | boolean | Name each tool call in the CLI's thinking line. Defaults to false. |
defaults | map | Shared defaults for every agent (see below). |
providers | map | Named provider blocks (see provider). |
config.defaults
| Field | Type | Values / default |
|---|---|---|
model | string | provider/model-id. No default. |
sandbox | string | A sandbox name. No default. |
thinking | string | A thinking level. Defaults to medium. |
max_tokens | number | Defaults to 8000. |
config
target: node
entry: age
audit: ~/.nt/audit
show_tool_calls: true
defaults:
model: anthropic/claude-sonnet-5
sandbox: workspace
thinking: medium
max_tokens: 8000
providers:
anthropic:
api: anthropic
api_key: env(ANTHROPIC_API_KEY)config.audit
This is one scalar setting: use a folder, a disable word, or an enable word.
| Value | Meaning |
|---|---|
| A folder path | Append every tool call to a daily .jsonl file there. |
off, none, disabled, no, false | Log nothing. |
on, yes, true, default | Log to the default folder, ~/.nt/audit. |
A leading ~ expands to the home folder; a relative folder resolves against the
.nt file that declared it. A map, a list, or an env() reference is an error.
Each line records the time, run id, agent, delegation depth, tool, tool kind,
input, success, duration, and output — with credentials redacted. Read them back
with nt audit, and see
Audit the tool calls for the full field list.
provider
Where the model comes from. Declared on its own or under config.providers.
| Field | Type | Values / default |
|---|---|---|
api | string | anthropic or openai-completions. Defaults to anthropic if the provider is named anthropic, otherwise openai-completions. |
base_url | string | Endpoint for OpenAI-style providers. Must be https (local addresses may use http). |
api_key | string | Use env(NAME). A literal key triggers a warning. |
headers | map | Extra request headers. |
provider ollama
api: openai-completions
base_url: http://localhost:11434/v1
api_key: env(OLLAMA_API_KEY, ollama)agent / subagent
The core worker. agent and subagent accept exactly the same fields.
| Field | Type | Values / default |
|---|---|---|
description | string | Short summary. Defaults to empty. |
model | string | provider/model-id. Falls back to config.defaults.model. |
instructions | string | The system prompt. Use a block scalar for multiple lines. |
thinking | string | A thinking level. Falls back to defaults. |
max_tokens | number | Reply length limit. Falls back to defaults (8000). |
sandbox | string | A sandbox name. Falls back to config.defaults.sandbox. |
cwd | string | Override the working directory for this agent. |
tools | list | Built-in tool names or your tool names. |
subagents | list | Names of subagent blocks it can delegate to. |
skills | list | Names of skill blocks to load. |
input | map | Typed input fields (see Field types). |
output | map | Typed output fields. When set, the reply is returned as JSON. |
message | string | An optional default message used when no input is given. |
agent age
description: Guesses a person's age from clues.
model: anthropic/claude-sonnet-5
thinking: high
max_tokens: 8000
sandbox: workspace
tools: [current_year, fs_write]
subagents: [researcher]
skills: [estimation]
instructions: |
Guess the person's most likely age from the clues.
input:
clues: string
output:
age: number
reason: stringBuilt-in tools
You can list these under tools without declaring them:
| Tool | What it does |
|---|---|
fs_read | Read a file in the sandbox. |
fs_write | Write a file in the sandbox. |
fs_list | List files in the sandbox. |
bash | Run a command in the sandbox. |
sandbox
The workspace an agent reads, writes, and runs commands in.
| Field | Type | Values / default |
|---|---|---|
description | string | Short summary. Defaults to empty. |
type | string | virtual (default) or local. |
cwd | string | Working directory. Defaults to /workspace. |
env | map | Environment values for commands. Values may use env(NAME). |
sandbox workspace
description: In-memory workspace.
type: virtual
cwd: /workspace
env:
GREETING: hellolocal needs opt-in
A local sandbox uses your real files and terminal. It only runs when you set NT_ALLOW_LOCAL=1
in your environment.
tool
A custom power an agent can call. {placeholders} are filled from the tool's
input. The built-in tool names (fs_read, fs_write, fs_list, bash) and
the delegate_to_ and mcp__ prefixes are reserved and cannot be used as tool names.
| Field | Type | Values / default |
|---|---|---|
description | string | Tells the model when to use it. Defaults to the tool name. |
type | string | shell (default) or http. |
command | string | The command to run (for shell tools). |
url | string | The address to call (for http tools). |
method | string | HTTP method for http tools. Defaults to GET. |
headers | map | Request headers for http tools. |
input | map | Typed inputs that fill {placeholders}. |
allow_internal | boolean | Allow http tools to call private or localhost addresses. Defaults to false. |
confirm | boolean | Ask in the terminal (a Yes/No selector) before every call. Defaults to false. |
tool current_year
description: Returns the current four-digit year.
type: shell
command: date +%Y
confirm: true
tool lookup
description: Fetch a record by id.
type: http
method: GET
url: https://api.example.com/records/{id}
input:
id: stringA tool with confirm: true never runs unapproved: the CLI stops and asks, the
--yes flag pre-approves, and a run with no way to ask (piped output, or an
embedder that wired no confirm callback) refuses the call. Recommended for
shell tools and http tools that POST.
mcp
Declares a local or remote MCP tool server. Loading and validation remain offline; connecting requires a separately persisted trust fingerprint.
| Field | Type | Values / default |
|---|---|---|
description | string | Human description. Defaults to the server name. |
transport | string | Required: stdio or streamable_http. |
tools | list/map | Selected remote names or policy entries. Defaults to none. |
connect_timeout_ms | number | 1,000–120,000. Defaults to 10000. |
call_timeout_ms | number | 1,000–600,000. Defaults to 60000. |
max_concurrency | number | 1–32 calls per server. Defaults to 4. |
include_instructions | boolean | Include bounded server instructions as untrusted prompt text. Default false. |
allow_internal | boolean | Permit private-network destinations. Default false. |
command | string | Required for stdio; executed directly without a shell. |
args | list | stdio arguments. Defaults to empty. |
cwd | string | stdio working directory. Defaults to . relative to the project root. |
allow_outside_cwd | boolean | Permit a stdio cwd outside the project. Default false. |
env | map | Explicit stdio environment additions; secret-shaped values require env(). |
url | string | Required HTTPS URL for streamable_http; literal loopback may use HTTP. |
auth | map | none, bearer, or oauth authentication. |
headers | map | Extra remote headers; Authorization is forbidden. |
allow_legacy_sse | boolean | Explicitly permit legacy SSE fallback. Default false. |
auth.type defaults to none. Bearer auth requires token: env(NAME) without
a fallback literal. OAuth accepts scopes: [...] and is completed with
nt mcp auth SERVER.
A tools list gives each selected tool the default required approval. Map
entries accept approval (required, once, or never), an optional local
description, and a per-tool call_timeout_ms. Its effective value is capped
at the server timeout. A wildcard "*" may not use never. See the
MCP guide for complete security and lifecycle examples.
skill
Reusable instructions loaded into an agent's prompt.
| Field | Type | Values / default |
|---|---|---|
description | string | Short summary. Defaults to the skill name. |
instructions | string | The reusable guidance. Use a block scalar for multiple lines. |
skill estimation
description: A checklist for guessing an age.
instructions: |
1. Turn each clue into a year.
2. Pick one number.workflow
A fixed sequence of steps that pass results forward.
| Field | Type | Values / default |
|---|---|---|
description | string | Short summary. Defaults to empty. |
agent | string | Default agent for steps that do not name one. |
input | map | Typed input for the whole workflow. |
output | map | Typed final result. |
steps | list | The steps to run, in order (see below). |
Each entry in steps accepts:
| Step field | Type | Values / default |
|---|---|---|
prompt | string | What to ask. Use {name} to insert input or earlier results. |
agent | string | Which agent runs this step. Falls back to the workflow's agent. |
skill | string | An optional skill to add for this step. |
into | string | A name to save this step's result under. |
workflow estimate_age
description: Find the year, then guess the age.
agent: age
input:
clues: string
output:
estimate: object
steps:
- agent: researcher
prompt: "What year does this point to: {clues}"
into: year
- prompt: |
Guess the age. Clues: {clues}. Year: {year}
into: estimateimport
Pulls in another file or folder. Put imports at the top of a file.
| Form | Meaning |
|---|---|
import ./file.nt | Import one file. |
import ./folder | Import every .nt file in a folder. |
import ./config.nt
import ./subagentsDefaults & limits
Handy values built into the engine:
| Name | Value |
|---|---|
Default thinking | medium |
Default max_tokens | 8000 |
Default sandbox cwd | /workspace |
Default audit folder | ~/.nt/audit |
| Audit file name | tools-YYYY-MM-DD.jsonl |
| Max steps per agent run | 12 |
| Max delegation depth | 6 |
| HTTP tool timeout | 30 seconds |
TypeScript engine API
Install @age.nt/engine when an application needs to embed NT instead of
launching the CLI:
npm install @age.nt/enginePublished packages contain compiled JavaScript and require Node 22.18 or newer.
The engine has three exact-pinned runtime dependencies: the official MCP client,
Ajv, and Undici. Model-provider requests use the platform fetch.
Load and run
import { Engine } from "@age.nt/engine";
const engine = Engine.load("age.nt", {
verbose: false,
onStep: (event) => console.error(event),
confirm: async (request) => {
console.error("Approval required", request.tool, request.input);
return false;
},
});
try {
const kind = engine.isRunnable("age");
const status = engine.bringUp();
const result = await engine.runAgent("age", { clues: "retired last year" });
const workflow = await engine.runWorkflow("estimate_age", { clues: "..." });
const chat = engine.createChat("age");
} finally {
await engine.close();
}EngineOptions accepts verbose, onStep, confirm, mcpTrustFile, and
mcpCredentialFile. The last two paths let an embedding application isolate
MCP persistence. A closed engine rejects new runtime and MCP work; close() is
idempotent and should always run in finally.
MCP methods
| Method | Result |
|---|---|
listMcp(server?, all?) | Live status and selected tools; all includes unselected tools. |
inspectMcp(server, remoteTool) | Normalized server and exact advertised-tool metadata. |
doctorMcp(server?) | Ten ordered diagnostics for one or every declaration. |
mcpTrustInfo(server) | Definition, fingerprint, and current trust status. |
trustMcp(server, expectedFingerprint?) | Persists the current fingerprint and returns it. |
untrustMcp(server) | Whether a persisted trust decision was removed. |
authorizeMcp(server, redirectUrl, onRedirect, callback) | Completes an embedder-owned OAuth callback and connects. |
logoutMcp(server) | Whether resource-bound OAuth credentials were removed. |
close() | Bounded settlement and cleanup of calls, clients, sessions, and child processes. |
Trust is never implicit. An embedder should display mcpTrustInfo, review its
boundary, and pass the displayed fingerprint to trustMcp before live
discovery. OAuth embedders own the loopback or application callback and pass its
validated query parameters to authorizeMcp.
Other exports
The package barrel also exports:
loadProjectanddiscoverNtFilesfor offline loading;ChatSessionfor stateful conversations;scaffoldProject,DEFAULT_TEMPLATE,SCAFFOLD_ENTRY_FILE, andTEMPLATE_NAMESfor starter projects;auditFilesandreadAuditEntriesfor bounded audit-log reads;NtErrorandMcpError(McpError.codeis a stableMCP_*value);- typed project definitions, statuses, results, callbacks, MCP metadata, diagnostics, and scaffold shapes exported from the package root.
Internal #... modules are not public API. Import consumers only from
@age.nt/engine.