# List workspace tool policies

Read the workspace policy of every tool of every integration in one call.

`GET https://api.smallworld.sh/api/v1/tool-policies`

## Request examples

### curl

```curl
curl --fail-with-body -X GET 'https://api.smallworld.sh/api/v1/tool-policies' \
  -H "Authorization: Bearer $SMALLWORLD_API_KEY"
```

### typescript

```typescript
const response = await fetch("https://api.smallworld.sh/api/v1/tool-policies", {
  method: "GET",
  headers: { Authorization: `Bearer ${apiKey}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();
```

### python

```python
response = requests.get(
    "https://api.smallworld.sh/api/v1/tool-policies",
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Responses

Returns items, without a pagination cursor. Returns integration, toolName, policy (the setting at this level: allow, ask, deny, or inherit when there is no override), effectivePolicy (allow, ask, or deny), and source: integration_default, world_override, group_override, user_override, workspace_hidden, group_hidden, or disabled. Workspace policies are never inherit.

### 200

Returns items, without a pagination cursor. Returns integration, toolName, policy (the setting at this level: allow, ask, deny, or inherit when there is no override), effectivePolicy (allow, ask, or deny), and source: integration_default, world_override, group_override, user_override, workspace_hidden, group_hidden, or disabled. Workspace policies are never inherit.

```json
{
  "items": [
    {
      "integration": "acme",
      "toolName": "get_order",
      "policy": "allow",
      "effectivePolicy": "allow",
      "source": "integration_default"
    },
    {
      "integration": "acme",
      "toolName": "refund_order",
      "policy": "deny",
      "effectivePolicy": "deny",
      "source": "workspace_hidden"
    }
  ]
}
```

### 400

invalid_request: A parameter is invalid; the message names the problem. Unknown query parameters are rejected.

#### invalid_request

A parameter is invalid; the message names the problem. Unknown query parameters are rejected.

```json
{
  "statusCode": 400,
  "code": "invalid_request",
  "message": "Unknown query parameter: color"
}
```

### 401

authentication_required: The Authorization header is missing or empty. invalid_api_key: The API key is invalid or revoked, or the header doesn't use the Bearer scheme.

#### authentication_required

The Authorization header is missing or empty.

```json
{
  "statusCode": 401,
  "code": "authentication_required",
  "message": "Authentication is required"
}
```

#### invalid_api_key

The API key is invalid or revoked, or the header doesn't use the Bearer scheme.

```json
{
  "statusCode": 401,
  "code": "invalid_api_key",
  "message": "The API key is invalid or revoked"
}
```

### 403

ip_not_allowed: The request came from an address outside the workspace's IP allowlist.

#### ip_not_allowed

The request came from an address outside the workspace's IP allowlist.

```json
{
  "statusCode": 403,
  "code": "ip_not_allowed",
  "message": "The source IP address is not allowed by this account's security settings"
}
```

### 500

internal_error: An unexpected server error.

#### internal_error

An unexpected server error.

```json
{
  "statusCode": 500,
  "code": "internal_error",
  "message": "Internal server error"
}
```

## Notes

- Set individual defaults with PUT /tool-policies/:integration/:toolName, or update a batch atomically with integration activation and World assignment through PATCH /integrations/:integration/configuration.

- deny means the workspace hides the tool: no World or user override can show it. Tools of an integration that is turned off have effectivePolicy deny and source disabled.

- Every integration in the catalog is listed, including ones the workspace hasn't added. Tools of an MCP server appear once a connection or the server reports them.
