> Source: https://wexa.ai/docs/agents/delete-agent

# delete-agent

[Can be held for approval](/docs/sdks-and-apis/how-every-tool-call-works#lifecycle-and-governance)

Delete an agent from the project's agent registry by its `agent_id`. Needs the `fabric:orchestrate.write` grant.

**Delete an agent**

**Wexa MCP server**

```bash
curl -sS -X POST https://fabric.wexa.ai/mcp/$FABRIC_PROJECT_ID \
  -H "authorization: Bearer $FABRIC_API_KEY" \
  -H "Mcp-Session-Id: $MCP_SESSION_ID" \
  -H "content-type: application/json" -H "accept: application/json" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"delete-agent","arguments":{"agent_id":"6ab196817566f41b5c28e335.6ab19681c73ec18cad7c9c48"}}}'
```

```json
{
  "content": [
    {
      "type": "text",
      "text": "{\"lifecycle_id\":\"qlc_000208\",\"result\":{\"agent_id\":\"6ab196817566f41b5c28e335.6ab19681c73ec18cad7c9c48\",\"container_remains\":false,\"deleted\":true}}"
    }
  ],
  "isError": false
}
```

**REST API**

```bash
curl -sS https://fabric.wexa.ai/v1/delete-agent \
  -H "authorization: Bearer $FABRIC_API_KEY" \
  -H "content-type: application/json" \
  -d '{"agent_id":"6ab196817566f41b5c28e335.6ab19681c73ec18cad7c9c48"}'
```

```json
{
  "lifecycle_id": "qlc_000208",
  "result": {
    "agent_id": "6ab196817566f41b5c28e335.6ab19681c73ec18cad7c9c48",
    "container_remains": false,
    "deleted": true
  }
}
```

**TypeScript SDK**

```ts
import { Fabric } from '@wexa-fabric/sdk'

const fabric = new Fabric()
const result = await fabric.deleteAgent({
  agent_id: '6ab196817566f41b5c28e335.6ab19681c73ec18cad7c9c48'
})
```

```ts
// result is the payload itself, with no `.result` to read
{
  agent_id: '6ab196817566f41b5c28e335.6ab19681c73ec18cad7c9c48',
  container_remains: false,
  deleted: true
}
```

**Python SDK**

```python
from wexa import Fabric

fabric = Fabric()
out = fabric.delete_agent(
    agent_id="6ab196817566f41b5c28e335.6ab19681c73ec18cad7c9c48",
)
```

```python
# out is the result, already unwrapped
{
    "agent_id": "6ab196817566f41b5c28e335.6ab19681c73ec18cad7c9c48",
    "container_remains": False,
    "deleted": True
}
```

## Parameters

| Parameter | Type | Required | Notes |
| --- | --- | --- | --- |
| `agent_id` | string | Required | Agent id from `list-agents` or `create-agent`. An agent in this project. |

**Show full response**

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

**Result of delete-agent**

**REST API**

```json
{
  "lifecycle_id": "qlc_000208",
  "result": {
    "agent_id": "6ab196817566f41b5c28e335.6ab19681c73ec18cad7c9c48",
    "container_remains": false,
    "deleted": true
  }
}
```

**Wexa MCP server**

```json
{
  "content": [
    {
      "type": "text",
      "text": "{\"lifecycle_id\":\"qlc_000208\",\"result\":{\"agent_id\":\"6ab196817566f41b5c28e335.6ab19681c73ec18cad7c9c48\",\"container_remains\":false,\"deleted\":true}}"
    }
  ],
  "isError": false
}
```

**TypeScript SDK**

```ts
// the object you get back IS the result — there is no `.result` to read
{
  agent_id: '6ab196817566f41b5c28e335.6ab19681c73ec18cad7c9c48',
  container_remains: false,
  deleted: true
}

// The TS SDK names these camelCase — lifecycleId, traceId — where Python uses
// lifecycle_id and trace_id. Both are non-enumerable: readable, but omitted by
// Object.keys() and JSON.stringify(). `result.lifecycleId` here is undefined.
result.lifecycleId // 'qlc_000208'
```

**Python SDK**

```python
# a dict subclass; `result` is already unwrapped
{
 "agent_id": "6ab196817566f41b5c28e335.6ab19681c73ec18cad7c9c48",
 "container_remains": False,
 "deleted": True
}

out.lifecycle_id  # 'qlc_000208' — an attribute, not a key
```

**More details**

Afterwards `get-agent` on that id reports not found. The container the agent was stored in goes with it, so nothing is left behind and no second call is needed. If that part fails the result carries `container_remains: true`, and [delete-process-flow](/docs/automation/delete-process-flow) removes it. For a multi-agent process flow use the process-flow tools instead.

Every tool call works the same way: [How every tool call works](/docs/sdks-and-apis/how-every-tool-call-works).
