# List the accounts and MCP servers connected to one agent made from a template.

`GET /o/{org}/agents/{agent}/connections`

The connections of one agent made from a template (`POST /o/{org}/agents {template, name}`), one per user of your own app. They belong to that agent alone: its runs use them and nothing else, and neither your own connections (`GET /me/connections`) nor another agent's appear here. Only the template's creator reads them. Each item has the shape `GET /me/connections` lists, with `agent`.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org` | path | string | yes | The org's slug or id. A caller with no role in the org gets `404`. |
| `agent` | path | string | yes | The id or name of an agent made from a template (`POST /o/{org}/agents {template, name}`). |

## Example request

```bash
curl "https://api.phoenix.so/o/$RUSH_ORG/agents/$AGENT/connections" \
  -H "Authorization: Bearer $RUSH_TOKEN"
```

```typescript
const org = process.env.RUSH_ORG;
const agent = process.env.AGENT;

const res = await fetch(`https://api.phoenix.so/o/${org}/agents/${agent}/connections`, {
  headers: {
    Authorization: `Bearer ${process.env.RUSH_TOKEN}`,
  },
});

console.log(res.status, await res.json());
```

```python
import os

import requests

org = os.environ["RUSH_ORG"]
agent = os.environ["AGENT"]

res = requests.get(
    f"https://api.phoenix.so/o/{org}/agents/{agent}/connections",
    headers={"Authorization": f"Bearer {os.environ['RUSH_TOKEN']}"},
)

print(res.status_code, res.json())
```

## Responses

### 200

The agent's connections.

- `connections` (array of AgentConnection, required)
  - `id` (string, required)
  - `type` (string, required, one of `app`, `mcp`)
  - `name` (string, optional): The name a session's `connections` and the template use.
  - `agent` (string, required): The agent the connection belongs to.
  - `url` (string, optional): The MCP server's address.
  - `auth` (object, optional)
    - `mode` (string, optional, one of `oauth`, `bearer`, `none`)
  - `status` (string, required, one of `pending`, `connected`, `failed`)
  - `authorize_url` (string, optional): Where the agent's user signs in. Single use; expires in 10 minutes.
  - `error` (object, optional)
    - `code` (string, optional, one of `connection_expired`, `cancelled_by_caller`, `connection_failed`)
    - `message` (string, optional)
  - `tools` (array of object, optional)
    - `name` (string, optional)
    - `title` (string, optional)
    - `description` (string, optional)
    - `read_only` (boolean, optional)

### 401

No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.

### 404

No such agent made from a template of yours (`NOT_FOUND`).

### 422

The agent is a template or a plain agent, which runs on your own connections (`INVALID_BODY`).

### 429

The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (`RATE_LIMITED`). The error names the limit. Wait `Retry-After` seconds.

## Example response (200)

```json
{
  "connections": [
    {
      "id": "c41e8a72-0d5b-4c9e-a3f6-71b2d8e45f09",
      "type": "app",
      "name": "outlook",
      "agent": "9b2f6c18-4e7a-4d35-8c91-5f0a3e7d2b66",
      "auth": {
        "mode": "oauth"
      },
      "status": "connected"
    },
    {
      "id": "5a8c2e14-6b3d-4f90-9e27-d1f4a0b8c763",
      "type": "mcp",
      "name": "notion",
      "agent": "9b2f6c18-4e7a-4d35-8c91-5f0a3e7d2b66",
      "url": "https://mcp.notion.com/mcp",
      "auth": {
        "mode": "oauth"
      },
      "status": "connected",
      "tools": [
        {
          "name": "notion-search",
          "title": "Search Notion",
          "description": "Search the workspace and connected sources.",
          "read_only": true
        },
        {
          "name": "notion-create-pages",
          "title": "Create pages",
          "description": "Create one or more pages with properties and content.",
          "read_only": false
        }
      ]
    }
  ]
}
```
