> ## Documentation Index
> Fetch the complete documentation index at: https://dialnexa.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Agent

> Use the update_agent MCP tool on the DialNexa remote MCP server.

Changes state - verify before retry

Updates a specific DRAFT version of an existing agent's configuration. This is NOT a read-only action. version\_number is required — published versions cannot be updated (only re-published). Only fields you provide are changed — omit anything you don't want to touch. timezone and pipeline\_type apply to the whole agent, so they are refused while a batch is running on it (AGENT\_HAS\_RUNNING\_BATCH). Phone numbers are managed with add\_agent\_phone\_number / remove\_agent\_phone\_number, not here. Use get\_agent first to see current values and version numbers.

## Parameters

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The agent ID, e.g. agent\_abc123 |
| `version_number` | `string` | Yes | The draft version number to update, e.g. 0 — from get\_agent |
| `title` | `string` | No | Display name for the agent |
| `description` | `string` | No | Internal description of what the agent does |
| `agent_type` | `string` | No | One of: Single\_Prompt\_Agent (default, one system prompt), Conversational\_Flow\_Agent (CFA — a more freeform persona-driven agent built from agent\_identity + agent\_background instead of a single scripted prompt), or IVR\_Agent (a DTMF touch-tone menu — 'press 1 for sales' — that plays pre-rendered static audio and routes by keypad, with no LLM/STT/TTS until it optionally hands off to another agent). If you're building a CFA step by step with the user: first ask what the agent's role/identity is (who it is, its purpose), then what background/context it should know, then any specific behavior rules — set agent\_identity, agent\_background, and prompt\_text from those answers respectively. Both agent\_identity and agent\_background are REQUIRED (non-empty) when agent\_type is Conversational\_Flow\_Agent — the call fails otherwise. When agent\_type is IVR\_Agent you must also supply ivr\_menu (see below); prompt\_text/language\_id/voice\_id are still required (the voice renders the menu audio at publish). |
| `ivr_menu` | `object (free-form)` | No | Menu tree for an IVR\_Agent (ignored for other agent types). Shape: \{ entry\_node: \<node id the call starts on>, nodes: \{ \<node id>: \<node> } }. Each node is \{ kind, prompt\_text, no\_input\_prompt\_text?, edges?, target\_agent\_id?, fallback\_dynamic\_variables? }. kind is one of: 'menu' (plays prompt\_text, then routes on the caller's keypress via edges), 'collect' (gathers keypad digits such as an order or booking reference; never a card number, bank account, government ID, PIN or password), 'connect\_agent' (hands the live call off in-process to another agent — set target\_agent\_id to that agent's id, agent\_ prefix ok; the target must be a NON-IVR agent in the same org that already has a published version. Also set fallback\_dynamic\_variables: a flat \{ variableName: value } map giving a fallback value for EVERY dynamic variable the target agent uses (its \{\{tokens}} plus any keys in its default\_dynamic\_variables) — publish is REJECTED unless each one has a non-empty value. These fill the transferred-to agent's prompt when the live call doesn't carry the value; the live call's own variables and any IVR-collected digits still take precedence at handoff), or 'hangup' (plays an optional farewell then ends the call). There is no 'promote' kind: to hand the caller to an AI agent, use connect\_agent. edges is a map of pressed digit -> target node id, e.g. \{ "1": "sales", "2": "support" } — every target must be a defined node. IMPORTANT: all IVR prompts must be STATIC text — no \{\{dynamic\_variable}} tokens (they'd be spoken literally; publish rejects them). The menu is validated and its audio pre-rendered at publish, not at create/update, so an invalid menu surfaces when you call publish\_agent. |
| `agent_identity` | `string` | No | Required (non-empty) when agent\_type is Conversational\_Flow\_Agent — who the agent is and its role/purpose. Not used by Single\_Prompt\_Agent. |
| `agent_background` | `string` | No | Required (non-empty) when agent\_type is Conversational\_Flow\_Agent — background/context the agent should know. Not used by Single\_Prompt\_Agent. |
| `folder_id` | `string` | No | Folder ID to file this agent under, e.g. from list\_organization\_folders |
| `prompt_text` | `string` | No | The agent's system/behavior prompt |
| `welcome_message` | `string` | No | First thing the agent says when a call connects |
| `language_id` | `string` | No | Language ID, e.g. lang\_abc123 — from list\_languages |
| `secondary_language_ids` | `array` | No | Up to 3 further language IDs (lang\_...) the agent also answers in — from list\_languages. The chosen voice must speak every one of them; any it cannot speak is dropped on save. Order matters: speech language hints follow it. Not allowed with Multilingual (code mul), which detects every language on its own and must be the only language. Speech-to-Speech agents cannot use Multilingual at all. |
| `language_default_message` | `string` | No | Sentence spoken, in the primary language voice, when a caller uses a language outside the primary and secondaries. Omit to let the agent answer normally. |
| `voice_id` | `string` | No | Voice ID, e.g. voice\_abc123 — from list\_voices |
| `llm_id` | `string` | No | LLM ID, e.g. llm\_abc123 — from list\_llms |
| `transcriber_id` | `string` | No | Transcriber ID, e.g. trs\_abc123 — from list\_transcribers |
| `transcriber_auto` | `boolean` | No | Auto transcriber, for single-prompt and conversational-flow agents on the cascaded pipeline (ignored for speech-to-speech and IVR agents): the platform picks the STT pair for the agent languages and keeps it current. A new agent gets Auto when no transcriber field is given; passing transcriber\_id turns it off; true ignores any transcriber fields sent with it. |
| `extra_config` | `object (free-form)` | No | Any other CreateAgentDto/UpdateAgentDto field not listed above (voice\_speed, kb\_max\_chunks, fallback settings, etc.). ID-shaped fields are normalized the same as the named fields above — pass them in their normal prefixed form as returned by other tools: knowledge\_base\_ids (kb\_..., from list\_knowledge\_base\_documents), webhook\_id (webhook\_...), llm\_fallback\_model/fall\_back\_llm\_id/post\_call\_analysis\_llm\_id (llm\_...), stt\_fallback\_transcriber\_id (trs\_...), fallback\_voices\[].voice\_id (voice\_...). Everything else is passed through as-is. Use get\_agent on a similar existing agent of the SAME agent\_type to see the full field shape first — do not copy fields from a different agent\_type. In particular, default\_dynamic\_variables.agent\_transfer\_destinations only applies to Conversational\_Flow\_Agent (its call-transfer node) and will be rejected on a Single\_Prompt\_Agent. |

## Complete input schema

```json theme={null}
{
  "type": "object",
  "properties": {
    "agent_id": {
      "type": "string",
      "description": "The agent ID, e.g. agent_abc123"
    },
    "version_number": {
      "type": "string",
      "description": "The draft version number to update, e.g. 0 — from get_agent"
    },
    "title": {
      "type": "string",
      "description": "Display name for the agent"
    },
    "description": {
      "type": "string",
      "description": "Internal description of what the agent does"
    },
    "agent_type": {
      "type": "string",
      "description": "One of: Single_Prompt_Agent (default, one system prompt), Conversational_Flow_Agent (CFA — a more freeform persona-driven agent built from agent_identity + agent_background instead of a single scripted prompt), or IVR_Agent (a DTMF touch-tone menu — 'press 1 for sales' — that plays pre-rendered static audio and routes by keypad, with no LLM/STT/TTS until it optionally hands off to another agent). If you're building a CFA step by step with the user: first ask what the agent's role/identity is (who it is, its purpose), then what background/context it should know, then any specific behavior rules — set agent_identity, agent_background, and prompt_text from those answers respectively. Both agent_identity and agent_background are REQUIRED (non-empty) when agent_type is Conversational_Flow_Agent — the call fails otherwise. When agent_type is IVR_Agent you must also supply ivr_menu (see below); prompt_text/language_id/voice_id are still required (the voice renders the menu audio at publish)."
    },
    "ivr_menu": {
      "type": "object",
      "additionalProperties": {},
      "description": "Menu tree for an IVR_Agent (ignored for other agent types). Shape: { entry_node: <node id the call starts on>, nodes: { <node id>: <node> } }. Each node is { kind, prompt_text, no_input_prompt_text?, edges?, target_agent_id?, fallback_dynamic_variables? }. kind is one of: 'menu' (plays prompt_text, then routes on the caller's keypress via edges), 'collect' (gathers keypad digits such as an order or booking reference; never a card number, bank account, government ID, PIN or password), 'connect_agent' (hands the live call off in-process to another agent — set target_agent_id to that agent's id, agent_ prefix ok; the target must be a NON-IVR agent in the same org that already has a published version. Also set fallback_dynamic_variables: a flat { variableName: value } map giving a fallback value for EVERY dynamic variable the target agent uses (its {{tokens}} plus any keys in its default_dynamic_variables) — publish is REJECTED unless each one has a non-empty value. These fill the transferred-to agent's prompt when the live call doesn't carry the value; the live call's own variables and any IVR-collected digits still take precedence at handoff), or 'hangup' (plays an optional farewell then ends the call). There is no 'promote' kind: to hand the caller to an AI agent, use connect_agent. edges is a map of pressed digit -> target node id, e.g. { \"1\": \"sales\", \"2\": \"support\" } — every target must be a defined node. IMPORTANT: all IVR prompts must be STATIC text — no {{dynamic_variable}} tokens (they'd be spoken literally; publish rejects them). The menu is validated and its audio pre-rendered at publish, not at create/update, so an invalid menu surfaces when you call publish_agent."
    },
    "agent_identity": {
      "type": "string",
      "description": "Required (non-empty) when agent_type is Conversational_Flow_Agent — who the agent is and its role/purpose. Not used by Single_Prompt_Agent."
    },
    "agent_background": {
      "type": "string",
      "description": "Required (non-empty) when agent_type is Conversational_Flow_Agent — background/context the agent should know. Not used by Single_Prompt_Agent."
    },
    "folder_id": {
      "type": "string",
      "description": "Folder ID to file this agent under, e.g. from list_organization_folders"
    },
    "prompt_text": {
      "type": "string",
      "description": "The agent's system/behavior prompt"
    },
    "welcome_message": {
      "type": "string",
      "description": "First thing the agent says when a call connects"
    },
    "language_id": {
      "type": "string",
      "description": "Language ID, e.g. lang_abc123 — from list_languages"
    },
    "secondary_language_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 3,
      "description": "Up to 3 further language IDs (lang_...) the agent also answers in — from list_languages. The chosen voice must speak every one of them; any it cannot speak is dropped on save. Order matters: speech language hints follow it. Not allowed with Multilingual (code mul), which detects every language on its own and must be the only language. Speech-to-Speech agents cannot use Multilingual at all."
    },
    "language_default_message": {
      "type": "string",
      "description": "Sentence spoken, in the primary language voice, when a caller uses a language outside the primary and secondaries. Omit to let the agent answer normally."
    },
    "voice_id": {
      "type": "string",
      "description": "Voice ID, e.g. voice_abc123 — from list_voices"
    },
    "llm_id": {
      "type": "string",
      "description": "LLM ID, e.g. llm_abc123 — from list_llms"
    },
    "transcriber_id": {
      "type": "string",
      "description": "Transcriber ID, e.g. trs_abc123 — from list_transcribers"
    },
    "transcriber_auto": {
      "type": "boolean",
      "description": "Auto transcriber, for single-prompt and conversational-flow agents on the cascaded pipeline (ignored for speech-to-speech and IVR agents): the platform picks the STT pair for the agent languages and keeps it current. A new agent gets Auto when no transcriber field is given; passing transcriber_id turns it off; true ignores any transcriber fields sent with it."
    },
    "extra_config": {
      "type": "object",
      "additionalProperties": {},
      "description": "Any other CreateAgentDto/UpdateAgentDto field not listed above (voice_speed, kb_max_chunks, fallback settings, etc.). ID-shaped fields are normalized the same as the named fields above — pass them in their normal prefixed form as returned by other tools: knowledge_base_ids (kb_..., from list_knowledge_base_documents), webhook_id (webhook_...), llm_fallback_model/fall_back_llm_id/post_call_analysis_llm_id (llm_...), stt_fallback_transcriber_id (trs_...), fallback_voices[].voice_id (voice_...). Everything else is passed through as-is. Use get_agent on a similar existing agent of the SAME agent_type to see the full field shape first — do not copy fields from a different agent_type. In particular, default_dynamic_variables.agent_transfer_destinations only applies to Conversational_Flow_Agent (its call-transfer node) and will be rejected on a Single_Prompt_Agent."
    }
  },
  "required": [
    "agent_id",
    "version_number"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
```

## Registered output schema

```json theme={null}
{
  "type": "object",
  "properties": {
    "id": {
      "description": "The agent ID, prefixed agent_"
    },
    "agent_type": {
      "description": "Single_Prompt_Agent, Conversational_Flow_Agent, or IVR_Agent"
    },
    "current_version_number": {
      "description": "Version number currently considered current"
    },
    "versions": {
      "description": "All versions of the agent after the update, each with its prompt, functions, and settings"
    },
    "prompt_health": {
      "description": "Prompt size against the selected model's latency bands: status (green/yellow/red/over_ceiling/not_applicable), prompt_tokens (an estimate), limit_tokens, system_prompt_reserved_tokens, limited_by, comment. over_ceiling means the draft WAS saved, but publish_agent will be refused until the prompt is shortened or a model with a larger limit is chosen."
    }
  },
  "additionalProperties": true,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
```

## Before you call

* Connect and initialize the MCP client with OAuth or an API key for the intended workspace.
* Provide the required parameters: `agent_id`, `version_number`.
* If your OAuth grant covers several workspaces, also pass `organization_id` with the workspace to act in, from [List My Organizations](https://dialnexa.com/docs/mcp-tools/organization/list-my-organizations.md).

## Example MCP request

Send `tools/call` after your client completes MCP initialization. Replace placeholder values with IDs and inputs from your workspace. For object and array parameters, follow the nested requirements in the parameter description instead of treating an empty value as complete.

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_agent",
    "arguments": {
      "agent_id": "agent_abc123",
      "version_number": "1"
    }
  }
}
```

Successful results include `structuredContent` and a text content block containing the same JSON. Check `isError` first, then read `structuredContent` or parse `content[0].text`. See [MCP responses and errors](https://dialnexa.com/docs/mcp-tools/errors.md) for the full envelope and failure behavior.

## Verify the result

Confirm the response is not marked `isError`. Call [Get Agent](https://dialnexa.com/docs/mcp-tools/agents/get-agent.md) to read the affected resource. Verify that the intended state is visible before making another change.

## Retry safety

This tool changes workspace state. After a timeout, read the affected resource before retrying so you do not create duplicate or conflicting changes.

## Related MCP tools

* [Get Agent](https://dialnexa.com/docs/mcp-tools/agents/get-agent.md): `get_agent`
* [Publish Agent](https://dialnexa.com/docs/mcp-tools/agents/publish-agent.md): `publish_agent`
* [List LLMs](https://dialnexa.com/docs/mcp-tools/reference-data/list-llms.md): `list_llms`
* [List Languages](https://dialnexa.com/docs/mcp-tools/reference-data/list-languages.md): `list_languages`
* [List Voices](https://dialnexa.com/docs/mcp-tools/reference-data/list-voices.md): `list_voices`
* [List Transcribers](https://dialnexa.com/docs/mcp-tools/reference-data/list-transcribers.md): `list_transcribers`
* [List Knowledge Base Documents](https://dialnexa.com/docs/mcp-tools/knowledge-base/list-knowledge-base-documents.md): `list_knowledge_base_documents`
* [List Organization Folders](https://dialnexa.com/docs/mcp-tools/organization/list-organization-folders.md): `list_organization_folders`
* [Attach Phone Number To Agent](https://dialnexa.com/docs/mcp-tools/phone-numbers/add-agent-phone-number.md): `add_agent_phone_number`
* [Detach Phone Number From Agent](https://dialnexa.com/docs/mcp-tools/phone-numbers/remove-agent-phone-number.md): `remove_agent_phone_number`
* [List Agents](https://dialnexa.com/docs/mcp-tools/agents/list-agents.md): `list_agents`
* [Get Agent Builder Inventory](https://dialnexa.com/docs/mcp-tools/agents/get-agent-builder-inventory.md): `get_agent_builder_inventory`

## Related guides

* [Connect to the DialNexa MCP server](https://dialnexa.com/docs/mcp-tools/overview.md)
* [Agents MCP tools](https://dialnexa.com/docs/mcp-tools/agents/overview.md)
* [MCP responses and errors](https://dialnexa.com/docs/mcp-tools/errors.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.