# update()

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

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

غيّر الأدوات المسموح بها، فئة الاذن، الرمز، العلامة أو العنوان. فقط ما تمرره هو الذي تمسّه.

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

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `tools` | string[] |  | **لا** -القائمة المسموح بها `[]` لا يسمح بأي شيء. |
| `category` | string |  | `read` · `write` · `exec`. |
| `token` | string|null |  | أي جديد يُنظّفُ نفس الطريقِ. `null` يزيله. |
| `label` | string |  | الاسم الذي هو اسم العرض. |
| `url` | string |  | عنوان جديد - تم التحقق منه كوصلة جديدة. |

```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: [] });
```

## أدوات الاستبدال، لا تضاف {#replaces}

> **أنت تريد**
>
> جاري إرسال اسم واحد يترك بالضبط أداة واحدة مسموح بها. لإضافة واحد، اقرأ القائمة الحالية مع الحصول على () وأرسلها مع الإضافة.

```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"] });
```

## تغيير الفئة هو قرار إذن {#category}

`read` كل أداة من هذا الخادم حرّة لتتصل في كلّ نمط لكن الخطة. ضبطه فقط عندما تعرف ما الذي يفعلونه جميعاً -- الصنف هو الخادم ، ليس الـ أداة ، لذا كتابة واحدة بين قراءة واحدة سبب كافي لتركها عند `exec`.

## عنوان جديد يمر من خلال نفس الشيك {#url}

وعنوان لا يمر مع رفض `url_blocked` و الـ اتصاله تُركت كما كانت

## جاري تشغيل خادم {#off}

`tools: []` مفيد لإيقاف خادم سوء التصرف يصل إلى أيّ عملية، دون فقدان شهادة التفويض.

- [الأدوات المسموح بها](/ar/sdk/mcp/allowed-tools): لماذا لا يسمح بأي شيء بالافتراض
- [disconnect()](/ar/sdk/ref/mcp/disconnect): -أبطلت تماماً
- [api.mcp](/ar/sdk/ref/mcp): الاتصال بخادم وعرضه واستخدامه.

```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"])
```
