# ExternalOperation

A tool (external operation): what an agent sees and calls. It points at one version of a connector, tells the model when to use it, fixes values the model must not choose, and can require a person's approval. Each change adds a new version, and agents, interactions, apps and code pipelines keep calling the version they were built against.

**Kind:** one of several shapes, used in responses.

## Shapes

The `$type` field says which shape it is, and comes first.

| `$type` | Shape |
|---|---|
| `"mcp"` | [`McpExternalOperation`](https://docs.maitento.com/reference/types/mcp-external-operation.md) |
| `"openapi"` | [`OpenApiExternalOperation`](https://docs.maitento.com/reference/types/open-api-external-operation.md) |

## Example

```json
{
  "$type": "mcp",
  "versions": [
    {}
  ],
  "name": "...",
  "namespaceId": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "tenantId": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "id": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "dateCreated": "2026-10-26T12:00:00.0000000Z",
  "dateUpdated": "2026-10-26T12:00:00.0000000Z"
}
```

## Where it's used

- [`tools.disableVersion`](https://docs.maitento.com/reference/api/tools.md) (`POST /external-operations/by-id/{id}/versions/{version}/disable`)
- [`tools.enableVersion`](https://docs.maitento.com/reference/api/tools.md) (`POST /external-operations/by-id/{id}/versions/{version}/enable`)
- [`tools.getByName`](https://docs.maitento.com/reference/api/tools.md) (`GET /namespaces/{namespaceName}/external-operations/by-name/{name}`)
- [`tools.get`](https://docs.maitento.com/reference/api/tools.md) (`GET /external-operations/by-id/{id}`)
- [`tools.list`](https://docs.maitento.com/reference/api/tools.md) (`GET /external-operations`)
- [`tools.list`](https://docs.maitento.com/reference/api/tools.md) (`GET /namespaces/{namespaceName}/external-operations`)
