On this page

create-agent

Create an agent in the Orchestrate Agents registry and return its agent_id, which get-agent, update-agent, delete-agent and run-agent all accept unchanged. Supply agent fields only. To build a MULTI-AGENT process flow use create-process-flow instead.

What it is called on each surface

The wire name is create-agent everywhere: it is what the Wexa MCP server advertises, the REST path is POST /v1/create-agent, and each SDK exposes it under its own language's naming convention.

SurfaceName
Wexa MCP servercreate-agent
REST APIPOST /v1/create-agent
TypeScript SDKfabric.createAgent()
Python SDKfabric.create_agent()

Arguments

1 of the 9 arguments is required. Omitting a required one is refused before the tool runs, at the validation stage, so it costs nothing and changes nothing.

ArgumentTypeRequiredNotes
contextarrayOptionalKnowledge-base context tags.
descriptionstringOptional—
has_knowledge_basebooleanOptional—
modelstringOptionalModel id from list-models settable. Omitted, the agent is stored with the organization's default model from the AI Models registry, or the first registry model when none is marked default.
namestringRequiredAgent name.
promptstringOptionalSystem prompt template.
rolestringOptionalOverrides 'type' as the stored role.
skill_idsarrayOptionalExisting skill ids (list-skills).
typestringOptionalAgent type as shown in the console (default "Conversational").

project_id, projectID, organization_id and executed_by are not arguments you pass: the platform binds all four from the credential you authenticated with, and both SDKs refuse them before the request leaves your process — see server-bound arguments.

What it returns

The three surfaces wrap this differently, and code written against one will not read another correctly — see return shape.

A real response, captured from a live call to create-agent:

{
  "content": [
    {
      "type": "text",
      "text": "{\"lifecycle_id\":\"qlc_000207\",\"result\":{\"agent_id\":\"6ab196817566f41b5c28e335.6ab19681c73ec18cad7c9c48\"}}"
    }
  ],
  "isError": false
}

Keeping the lifecycle_id is what lets you ask later why a call was allowed, refused or held.

Calling it

The same call on all four surfaces. Pick a tab once and every code block in the documentation follows it.

The ids in this example are real, and resolve against the project the documentation is written against. Swap them for your own. A value in angle brackets is one only you can supply, and the platform refuses a literal <...>.

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "create-agent",
    "arguments": {
      "name": "<name>"
    }
  }
}

Errors

Both SDKs raise the same typed errors, chosen from the gateway's own error string first and its HTTP status second. create-agent checks the fabric:orchestrate.write grant, and reaches the seven classes every tool reaches — listed under the common set. These are the ones specific to it:

ErrorStatusRaised when
NotFound404A skill_ids entry is not one this project has. Call list-skills first.
ValidationError422The named model is not in the organization's AI Models registry (system_model included), or no model was named and the registry is empty. Call list-models and pass an id from settable.
ApprovalRequired202A policy held this call for a person to approve. The error carries the approval id; see below.
ConfigurationError5xxcreate-agent is not available to you. Retrying will not help.

Governance

Every call to create-agent runs through the same ten-stage lifecycle as every other Wexa tool: the credential is resolved to a scope, the fabric:orchestrate.write grant is checked, quota is drawn down, the arguments are validated, policy rules are evaluated, the call is executed, the result is shaped and redacted, and an audit record is written. The lifecycle_id in the response is the handle to that record.

create-agent is marked consequential, which means it changes something rather than only reading. Two things follow. It is audited in full rather than lightly, and a policy rule may hold it for human approval — in which case the call returns 202 and an ApprovalRequired error carrying the approval id, and the SDKs can wait for the decision and resume rather than making you call again.

See also

The tool index, errors, and which identifier goes where.