> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Discover OpenAPI tools

`POST /api/v1/custom-providers/{provider_identifier}:collect-tools`

Queues a tool collection run for a connector created from an OpenAPI spec. The run reads the connector's spec again and updates its tools to match. It returns at once with the status `QUEUED`: poll [OpenAPI tool discovery status](https://docs.scalekit.com/agentkit/reference/tools/get-openapi-tool-collection-run/) with the returned `run_id` for the outcome.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `provider_identifier` | string | Yes | The connector's `identifier` (`NAME:environment-id`), not its `id`. |

**Response (200)**

| Name | Type | Description |
| --- | --- | --- |
| `created_at` | string | When the run was queued. |
| `error_message` | string | Why the run failed. Empty unless `status` is `FAILED`. |
| `finished_at` | string | When the run ended. |
| `provider_identifier` | string | Identifier of the connector the run belongs to. |
| `run_id` | string | ID of the run. |
| `skipped_tools_json` | string | JSON text listing the operations the run did not turn into tools. Empty until the run ends. |
| `started_at` | string | When the run started. |
| `status` | string | `QUEUED`, `PROCESSING`, `COMPLETED` or `FAILED`. |
| `tools_created` | integer | Number of tools the run created. |
| `tools_deleted` | integer | Number of tools the run deleted because their operation left the spec. |
| `tools_updated` | integer | Number of tools the run updated. |
| `total_endpoints` | integer | Number of operations found in the spec. |

**Errors**

- `400`: Invalid request - the connector was not created from an OpenAPI spec
- `404`: Not Found - no connector has this identifier
- `409`: Conflict - `RESOURCE_ALREADY_EXISTS` when a tool collection run is already queued or processing for this connector

**Request**

```bash
curl -sS -X POST \
  "$SCALEKIT_ENVIRONMENT_URL/api/v1/custom-providers/EXAMPLEAPI:12345:collect-tools" \
  -H "Authorization: Bearer $TOKEN"
```

**Response**

```json
{
  "run_id": "tcr_153432495495315592",
  "provider_identifier": "EXAMPLEAPI:12345",
  "status": "QUEUED",
  "total_endpoints": 0,
  "tools_created": 0,
  "tools_updated": 0,
  "tools_deleted": 0,
  "skipped_tools_json": "",
  "error_message": "",
  "created_at": "2026-11-02T10:15:04Z"
}
```

**Python SDK:** `scalekit_client.actions.invoke_tool_collection`

Queues a tool collection run for a connector created from an OpenAPI spec. Follow the run with `get_tool_collection_run`.

```python
scalekit_client.actions.invoke_tool_collection(
    provider_identifier: str,
) -> ToolCollectionRun
```

Example:

```python
run = scalekit_client.actions.invoke_tool_collection(
    provider_identifier="EXAMPLEAPI:12345",
)
```

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `provider_identifier` | `str` | Yes | The connector's `identifier` (`NAME:environment-id`), not its `id`. |

Returns `ToolCollectionRun`: The queued `ToolCollectionRun`.

**Node.js SDK:** `scalekit.actions.invokeToolCollection`

Queues a tool collection run for a connector created from an OpenAPI spec. Follow the run with `getToolCollectionRun`.

```ts
scalekit.actions.invokeToolCollection(
  params: {
    providerIdentifier: string;
  },
): Promise<ToolCollectionRun>
```

Example:

```ts
const result = await scalekit.actions.invokeToolCollection({
  providerIdentifier: "EXAMPLEAPI:12345",
});
```

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `providerIdentifier` | `string` | Yes | The connector's `identifier` (`NAME:environment-id`), not its `id`. |

Returns `Promise<ToolCollectionRun>`: The queued `ToolCollectionRun`.


Part of [Tools](https://docs.scalekit.com/agentkit/reference/tools/) in the [AgentKit API reference](https://docs.scalekit.com/agentkit/reference/). Authentication: https://docs.scalekit.com/agentkit/reference/authentication.md. Errors and rate limits: https://docs.scalekit.com/agentkit/reference/errors.md. Pagination: https://docs.scalekit.com/agentkit/reference/pagination.md


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
