> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orkeia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Tool

> Updates the data of a tool.

## Endpoint

`PUT https://gateway.orkeia.ai/tools/{id}`

**Authentication**\
Requires header `authorization:  <your_token>`.

## Path Parameters

| Name | Type   | Required | Description                    | Example      |
| ---- | ------ | -------- | ------------------------------ | ------------ |
| id   | string | Yes      | Unique identifier of the tool. | TOOL\_123456 |

## Request Body (JSON)

```json theme={null}
{
  "name": "Nova Ferramenta",
  "description": "Descrição atualizada",
  "code": "export async function run(input){ return { ok: true }; }",
  "entryFunctionName": "run",
  "sectors": ["engineering"],
  "publisher": "Orkeia",
  "enabled": true,
  "environments": ["prod"],
  "mcp": {
    "url": "https://tools.orkeia.ai/my-tool",
    "transport": "sse"
  }
}
```

## Example (cURL)

```bash theme={null}
curl -X PUT "https://gateway.orkeia.ai/tools/TOOL_123456"   -H "authorization:  <your_token>"   -H "Content-Type: application/json"   -d '{
    "name": "Nova Ferramenta",
    "description": "Descrição atualizada",
    "code": "export async function run(input){ return { ok: true }; }",
    "entryFunctionName": "run",
    "sectors": ["engineering"],
    "publisher": "Orkeia",
    "enabled": true,
    "environments": ["prod"],
    "mcp": { "url": "https://tools.orkeia.ai/my-tool", "transport": "sse" }
  }'
```

## Responses

### Response - Success

```json response theme={null}
{
  "status": "OK",
  "data": {
    "id": "TOOL_123456",
    "name": "Nova Ferramenta",
    "description": "Descrição atualizada",
    "code": "export async function run(input){ return { ok: true }; }",
    "entryFunctionName": "run",
    "sectors": ["engineering"],
    "publisher": "Orkeia",
    "enabled": true,
    "environments": ["prod"],
    "mcp": {
      "url": "https://tools.orkeia.ai/my-tool",
      "transport": "sse"
    },
    "createdAt": "2024-07-15T14:25:18.000Z"
  }
}
```

### 500 — Server Error

```json theme={null}
{
  "status": "ERROR",
  "code": "server/error",
  "data": null
}
```

### 400 — Client Error

```json theme={null}
{
  "status": "ERROR",
  "code": "client/error",
  "data": null
}
```

## Fields

| Field             | Type                       | Description                                   |
| ----------------- | -------------------------- | --------------------------------------------- |
| id                | string                     | ID of the tool.                               |
| name              | string                     | Name of the tool.                             |
| description       | string                     | Description of the tool.                      |
| code              | string                     | Executable code associated (when applicable). |
| entryFunctionName | string                     | Entry function in `code`.                     |
| sectors           | string\[]                  | Allowed sectors.                              |
| publisher         | string                     | Who published/created the tool.               |
| enabled           | boolean                    | Indicates if it is enabled.                   |
| environments      | string\[]                  | Environments in which it is available.        |
| mcp               | object                     | MCP configuration (when applicable).          |
| mcp.url           | string                     | URL of the MCP.                               |
| mcp.transport     | 'sse' \| 'streamable-http' | Type of MCP transport.                        |
| createdAt         | string                     | Creation date in ISO 8601 format.             |
