> ## 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.

# Create Agent

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

<span data-api-safety-label="changes-state"><Badge color="yellow" size="sm" shape="pill">Changes state - verify before retry</Badge></span>

Creates a new voice agent for the organization. This is NOT a read-only action — it creates a real, persistent agent. prompt\_text, language\_id, and voice\_id are required; everything else has sensible defaults. Use list\_languages/list\_voices/list\_llms/list\_transcribers first to get valid IDs. Only call this after the user has described what they want the agent to do — never as a guess.

## Parameters

| Name               | Type                 | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------------ | -------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `title`            | `string`             | No       | Display name for the agent                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `description`      | `string`             | No       | Internal description of what the agent does                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `agent_type`       | `string`             | No       | Single\_Prompt\_Agent (default, one system prompt) or Conversational\_Flow\_Agent (CFA — a more freeform persona-driven agent built from agent\_identity + agent\_background instead of a single scripted prompt). 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.                                                                  |
| `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`             | Yes      | The agent's system/behavior prompt (required)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `welcome_message`  | `string`             | No       | First thing the agent says when a call connects                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `language_id`      | `string`             | Yes      | Language ID, e.g. lang\_abc123 — from list\_languages (required)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `voice_id`         | `string`             | Yes      | Voice ID, e.g. voice\_abc123 — from list\_voices (required)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `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), inbound\_phone\_number\_id/outbound\_phone\_number\_id (phn\_...), 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 to see the full field shape first. |

## Before you call

* Connect and initialize the MCP client with OAuth or an API key for the intended workspace.
* Provide the required parameters: `prompt_text`, `language_id`, `voice_id`.

## 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": "create_agent",
    "arguments": {
      "prompt_text": "Describe how the agent should behave.",
      "language_id": "lang_abc123",
      "voice_id": "voice_abc123"
    }
  }
}
```

The server returns one text content block. Parse `content[0].text` as JSON when the tool succeeds. See [MCP responses and errors](/docs/mcp-tools/errors) for the full envelope and failure behavior.

## Verify the result

Confirm the response is not marked `isError`. Call [Get Agent](/docs/mcp-tools/agents/get-agent) 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](/docs/mcp-tools/agents/get-agent): `get_agent`
* [List Knowledge Base Documents](/docs/mcp-tools/knowledge-base/list-knowledge-base-documents): `list_knowledge_base_documents`
* [List LLMs](/docs/mcp-tools/reference-data/list-llms): `list_llms`
* [List Languages](/docs/mcp-tools/reference-data/list-languages): `list_languages`
* [List Voices](/docs/mcp-tools/reference-data/list-voices): `list_voices`
* [List Transcribers](/docs/mcp-tools/reference-data/list-transcribers): `list_transcribers`
* [List Organization Folders](/docs/mcp-tools/organization/list-organization-folders): `list_organization_folders`
* [List Agents](/docs/mcp-tools/agents/list-agents): `list_agents`
* [List Agent Versions](/docs/mcp-tools/agents/list-agent-versions): `list_agent_versions`

## Related guides

* [Connect to the DialNexa MCP server](/docs/mcp-tools/overview)
* [Agents MCP tools](/docs/mcp-tools/agents/overview)
* [MCP responses and errors](/docs/mcp-tools/errors)
