---
docId: doc_43d2cad8065342b18ea3e3817f1d8536
title: Connect a tool
description: Connects a tool that already exists in the workspace to an agent. It applies immediately and doesn't create a version.
api:
  group: agentes/herramientas
  auth: bearer
  operations:
    - operationId: connectAgentTool
      method: PUT
      path: '/v1/agents/{agentId}/tools/{toolId}'
      postmanName: Connect a tool
---

<script>
  import { Ways } from '$lib/components';
</script>

# Connect a tool

Connect an existing tool so an agent can use it. Send `agentId` and `toolId` in the URL. You can send `state: "paused"` if you do not want to activate it yet. **The connection applies immediately, without publishing**, and does not create a version.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X PUT https://api.platic.ai/v1/agents/$AGENT_ID/tools/$TOOL_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.agents.tools.connect("agent_123", "tool_123");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `agentId` | string | Agent id | ✓ |
| `toolId` | string | Tool id: the `id` from the [catalog](/api-reference/tools/list) | ✓ |

## Request body

Optional. Without a body, the connection is active. To connect it paused:

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `state` | string | `active` or `paused`. Defaults to `active`. With `paused` it is connected but the agent doesn't use it. | — |

```json
{ "state": "paused" }
```

## Response

`201 Created` with the new connection, or `200 OK` with the one that already existed:

```json
{
  "status": "success",
  "data": {
    "toolId": "8fK2mQpLxT4vNbRc",
    "name": "mcp_create_issue_a1b2c3",
    "description": "Create a new issue in Linear",
    "kind": "mcp",
    "state": "active",
    "toolExists": true,
    "attachedAt": "2026-07-14T18:05:22.881Z"
  }
}
```

`data` is the connection, with the fields from [List agent tools](/api-reference/agents/tools/list#response-fields).

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | `state` isn't `active` or `paused`. `details.issues` describes the problem. |
| `404` | `AGENT_NOT_FOUND` | The agent doesn't exist or belongs to another workspace. |
| `404` | `TOOL_NOT_FOUND` | The tool doesn't exist in this workspace. `details.toolId` names it. |

The format and codes for the rest of the API are in [Errors](/api-reference/errors).

## Notes

- The tool is shared with other agents; no copy is created. To create a new one, use a [custom API](/api-reference/custom-apis) or an [MCP server](/api-reference/mcp-servers).
- Connecting a tool that is already connected answers `200` and doesn't change its state, unless you send `state`: then the connection ends up in that state.
- For the agent to stop using it without losing the connection, use [Pause or resume a tool](/api-reference/agents/tools/pause). To remove it, [Disconnect a tool](/api-reference/agents/tools/disconnect).
- From an AI agent, the tool is [`connect_agent_tool`](/mcp/tools#tools).
