# update()

Canonical URL: https://developers.iagenify.com/pt/sdk/ref/mcp/update/
Language: pt

`api.mcp.update(name, { tools?, category?, token?, label?, url? }) → Promise<Server>`

Cambia le utens permese, la categoria di permission, il token, l'etichetta o l'indirizzo. Solo quello che passa è tocato.

Status: PATCH · tools replaces the list · a new address is checked

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `tools` | string[] |  | **Replace**la lista permisa. `[]`non permette. |
| `category` | string |  | `read` · `write` · `exec`. |
| `token` | string|null |  | Un nuovo token, pulit imememe. `null` lo remove. |
| `label` | string |  | Il nome display. |
| `url` | string |  | Un nuovo address — verificat come un nou connes. |

```javascript
// Allow two tools and nothing else
await api.mcp.update("example", { tools: ["search_docs", "get_issue"] });

// Make them free to call in auto mode
await api.mcp.update("example", { category: "read" });

// Rotate the token
await api.mcp.update("example", { token: process.env.EXAMPLE_TOKEN_NEW });

// Turn the server off without disconnecting it
await api.mcp.update("example", { tools: [] });
```

## utensilis substitue, non adjuvante {#replaces}

> **Passa la lista completa que vuoi**
>
> L'envio di un nome lascia esattamente un utensilio permessi. Per aggiunger uno, legî la lista corrente con get() e lo rimanda con l'addizio.

```javascript
const server = await api.mcp.get("example");
const allowed = server.tools.filter((t) => t.allowed).map((t) => t.name);
await api.mcp.update("example", { tools: [...allowed, "create_issue"] });
```

## Cambiare la categoria è una decisione di permission {#category}

`read` rende libere ogni utrel del server per chiamare in ogni modo, ma plan. Impostalo solo quando tu sai o che tutti loro fanno — la categoria è del servidor, non del utrel, quindi uno scrie entre lee è motivo suficiente per lascia-lo a `exec`.

## Un nuovo address passa per la stessa verifica {#url}

Schema, e che risolve publicamente. Un address che non passa è negatât con `url_blocked` e la connezion è lasciato come era.

## Desligare un servèrder {#off}

`tools: []` mantiene la connessione e sua getken mentre non dichiara nimic. Utile per impedir un servidor mal comportamentat checando qualsiasi run, senza perder la credencial.

- [Ferramentas permitidas](/pt/sdk/mcp/allowed-tools): Por qu'essunto è per default.
- [disconnect()](/pt/sdk/ref/mcp/disconnect): Retirando-lo integralmente.
- [api.mcp](/pt/sdk/ref/mcp): Conectar, listar e usar um servidor.

```python
import os

# Allow two tools and nothing else
api.mcp.update("example", tools=["search_docs", "get_issue"])

# Make them free to call in auto mode
api.mcp.update("example", category="read")

# Rotate the token
api.mcp.update("example", token=os.environ["EXAMPLE_TOKEN_NEW"])

# Turn the server off without disconnecting it
api.mcp.update("example", tools=[])
```

```python
server = api.mcp.get("example")
allowed = [t["name"] for t in server["tools"] if t["allowed"]]
api.mcp.update("example", tools=[*allowed, "create_issue"])
```
