Skip to content

The chat-agent endpoints manage chat-agent definitions stored under the resolving working directory. They expose list / create / copy / rename / delete lifecycle, read / write of the raw markdown source, and targeted frontmatter edits for the model, tool allow-list, and max-turns. Every read is realm-scoped to the gateway’s own realm; a client-supplied X-Hoody-Realm header is ignored. Mutating endpoints require a mutating posture on the daemon side.

GET /api/v1/agent/agents

Lists the chat-agent definitions resolved for the requesting cwd / config_dir (built-in + custom). Realm-scoped to the gateway’s own realm; a client-supplied realm selector is ignored.

NameInTypeRequiredDescription
pagequeryintegerNo1-based page number for pagination.
limitqueryintegerNoMaximum items per page (0 = no pagination).
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1): the .hoody project layer / record cwd / tool+workflow cwd. Required by routes that resolve a cwd.
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1) selecting which on-disk .hoody install a stateless read/write resolves.
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local). Rejected (400) on routes with no container dimension.
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1): "global" or a 24-hex id (also accepted as ?realm=). Rejected (400 realm_scope_unsupported) on active-only / no-realm routes.
realmquerystringNoPer-request realm selector (§6.1) — the in:query alias of the X-Hoody-Realm header (read only when the header is absent): "global" or a 24-hex id.
{
"items": [
{
"name": "code-reviewer",
"description": "Reviews PRs and suggests improvements",
"model": "anthropic/claude-opus-4-8",
"tools": ["read_file", "grep", "bash"],
"turns": 25
},
{
"name": "explorer",
"description": "Explores a codebase to answer questions",
"model": "anthropic/claude-sonnet-4-5",
"tools": ["read_file", "list_dir", "grep"],
"turns": 15
}
],
"meta": {
"total": 12,
"page": 1,
"limit": 50
}
}
const { items, meta } = await client.agent.agents.listAgentsIterator({ page: 1, limit: 50 });

GET /api/v1/agent/agents/{name}/source

Returns the raw markdown source (frontmatter + system prompt) of a chat-agent definition.

NameInTypeRequiredDescription
namepathstringYesPath identifier (the agent name).
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1).
realmquerystringNoPer-request realm selector (§6.1) — the in:query alias of the X-Hoody-Realm header.
{
"name": "code-reviewer",
"content": "---\nmodel: anthropic/claude-opus-4-8\ntools: [read_file, grep, bash]\nturns: 25\ndescription: Reviews PRs and suggests improvements\n---\n\nYou are a code reviewer. Read the diff, identify issues, and propose targeted fixes.\n",
"gen": 7
}
const source = await client.agent.agents.getAgentSource({ name: "code-reviewer" });

POST /api/v1/agent/agents

Creates (or overwrites) a custom chat-agent definition file from a name + frontmatter + system prompt.

NameInTypeRequiredDescription
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1).
realmquerystringNoPer-request realm selector (§6.1) — the in:query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
namestringYesAgent name (the definition file stem).
frontmatterobjectNoOptional frontmatter keys (model / tools / turns / description).
system_promptstringNoThe agent’s system prompt body.
{
"name": "code-reviewer",
"frontmatter": {
"model": "anthropic/claude-opus-4-8",
"tools": ["read_file", "grep", "bash"],
"turns": 25,
"description": "Reviews PRs and suggests improvements"
},
"system_prompt": "You are a code reviewer. Read the diff, identify issues, and propose targeted fixes."
}
{
"name": "code-reviewer",
"path": "/home/user/project/.hoody/agents/code-reviewer.md",
"created": true
}
await client.agent.agents.createAgent({
data: {
name: "code-reviewer",
frontmatter: {
model: "anthropic/claude-opus-4-8",
tools: ["read_file", "grep", "bash"],
turns: 25,
description: "Reviews PRs and suggests improvements"
},
system_prompt: "You are a code reviewer. Read the diff, identify issues, and propose targeted fixes."
}
});

POST /api/v1/agent/agents/{name}/copy

Copies a chat-agent definition to a new name.

NameInTypeRequiredDescription
namepathstringYesPath identifier (the source agent name).
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1).
realmquerystringNoPer-request realm selector (§6.1) — the in:query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
new_namestringYesName for the copied agent.
{
"new_name": "code-reviewer-strict"
}
{
"name": "code-reviewer-strict",
"path": "/home/user/project/.hoody/agents/code-reviewer-strict.md",
"source": "code-reviewer"
}
await client.agent.agents.copyAgent({
name: "code-reviewer",
data: { new_name: "code-reviewer-strict" }
});

POST /api/v1/agent/agents/{name}/rename

Renames a custom chat-agent definition.

NameInTypeRequiredDescription
namepathstringYesPath identifier (the current agent name).
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1).
realmquerystringNoPer-request realm selector (§6.1) — the in:query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
new_namestringYesNew agent name.
{
"new_name": "code-reviewer-v2"
}
{
"name": "code-reviewer-v2",
"old_name": "code-reviewer"
}
await client.agent.agents.renameAgent({
name: "code-reviewer",
data: { new_name: "code-reviewer-v2" }
});

POST /api/v1/agent/agents/{name}/reset-to-shipped

Restores one agent to its shipped default, discarding local customizations. An agent with no shipped default is refused.

NameInTypeRequiredDescription
namepathstringYesPath identifier (the agent name).
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1).
realmquerystringNoPer-request realm selector (§6.1) — the in:query alias of the X-Hoody-Realm header.
{
"output": "Agent 'code-reviewer' reset to shipped default.",
"is_error": false
}
await client.agent.agents.resetAgentToShipped({ name: "code-reviewer" });

POST /api/v1/agent/agents/{name}/tools/{tool}/toggle

Toggles one tool on/off in an agent’s frontmatter tools line. Omit enabled to flip the current state; supply an explicit enabled to force on/off.

NameInTypeRequiredDescription
namepathstringYesPath identifier (the agent name).
toolpathstringYesPath identifier (the tool name).
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1).
realmquerystringNoPer-request realm selector (§6.1) — the in:query alias of the X-Hoody-Realm header.

The body is a free-form pass-through to the daemon agents.toggle_tool RPC. Accepted fields are exactly those agents.toggle_tool reads; the most common is enabled.

{
"enabled": true
}
{
"name": "code-reviewer",
"tool": "bash",
"enabled": true
}
await client.agent.agents.toggleAgentTool({
name: "code-reviewer",
tool: "bash",
data: { enabled: true }
});

PUT /api/v1/agent/agents/{name}/source

Overwrites the raw markdown source of a chat-agent definition. Supply base_gen from a prior read to opt into conflict detection.

NameInTypeRequiredDescription
namepathstringYesPath identifier (the agent name).
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1).
realmquerystringNoPer-request realm selector (§6.1) — the in:query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
contentstringYesThe full markdown source (frontmatter + system prompt).
base_genintegerNoThe gen returned by agents.read_source, for conflict detection.
{
"content": "---\nmodel: anthropic/claude-sonnet-4-5\ntools: [read_file, grep]\nturns: 20\ndescription: Reviews PRs with a strict lens\n---\n\nYou are a strict code reviewer. Reject any change that lacks tests.\n",
"base_gen": 7
}
{
"name": "code-reviewer",
"gen": 8
}
await client.agent.agents.putAgentSource({
name: "code-reviewer",
data: {
content: "---\nmodel: anthropic/claude-sonnet-4-5\ntools: [read_file, grep]\nturns: 20\ndescription: Reviews PRs with a strict lens\n---\n\nYou are a strict code reviewer. Reject any change that lacks tests.\n",
base_gen: 7
}
});

PATCH /api/v1/agent/agents/{name}/model

Sets (or, with model: "", removes) an agent’s frontmatter model line.

NameInTypeRequiredDescription
namepathstringYesPath identifier (the agent name).
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1).
realmquerystringNoPer-request realm selector (§6.1) — the in:query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
modelstringNoModel spec (e.g. anthropic/claude-opus-4-8); "" removes the frontmatter model line.
{
"model": "anthropic/claude-opus-4-8"
}
{
"name": "code-reviewer",
"model": "anthropic/claude-opus-4-8"
}
await client.agent.agents.setAgentModel({
name: "code-reviewer",
data: { model: "anthropic/claude-opus-4-8" }
});

PATCH /api/v1/agent/agents/{name}/tools

Sets (or, with an empty list, removes — “all tools”) an agent’s frontmatter tools line.

NameInTypeRequiredDescription
namepathstringYesPath identifier (the agent name).
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1).
realmquerystringNoPer-request realm selector (§6.1) — the in:query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
toolsarrayNoTool names allowed for the agent; an empty list removes the line (= all tools).
{
"tools": ["read_file", "grep", "bash"]
}
{
"name": "code-reviewer",
"tools": ["read_file", "grep", "bash"]
}
await client.agent.agents.setAgentTools({
name: "code-reviewer",
data: { tools: ["read_file", "grep", "bash"] }
});

PATCH /api/v1/agent/agents/{name}/turns

Sets an agent’s max-turns frontmatter value.

NameInTypeRequiredDescription
namepathstringYesPath identifier (the agent name).
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1).
realmquerystringNoPer-request realm selector (§6.1) — the in:query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
turnsintegerNoMax agent turns per dispatch.
{
"turns": 30
}
{
"name": "code-reviewer",
"turns": 30
}
await client.agent.agents.setAgentTurns({
name: "code-reviewer",
data: { turns: 30 }
});

DELETE /api/v1/agent/agents/{name}

Deletes one custom chat-agent definition. Shipped-default agents and the configured default chat agent are refused by the daemon guard rails (use putAgentSource or resetAgentToShipped instead).

NameInTypeRequiredDescription
namepathstringYesPath identifier (the agent name).
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1).
realmquerystringNoPer-request realm selector (§6.1) — the in:query alias of the X-Hoody-Realm header.
{
"output": "Agent 'code-reviewer' deleted.",
"is_error": false
}
await client.agent.agents.deleteAgent({ name: "code-reviewer" });