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

# 工具定義

> 定義技能內可調用的操作。

工具賦予技能執行操作的能力。每個工具都有名稱、描述以及用於輸入的 JSON Schema。

```typescript theme={null}
tools: [
  {
    name: "check_stock",
    description: "Look up current stock levels by SKU and warehouse",
    inputSchema: {
      type: "object",
      properties: {
        sku: { type: "string" },
        warehouse: { type: "string" },
      },
      required: ["sku"],
    },
    requiresApproval: false,
    permissionLevel: "user",
  },
]
```

## SkillToolInput 字段

| 字段 | 類型 | 說明 |
| - | - | - |
| `name` | `string` | 僅小寫字母、數字與下劃線 |
| `description` | `string` | 工具的作用說明(模型會讀取此內容) |
| `inputSchema` | `object` | 用於參數的 JSON Schema |
| `outputSchema` | `object` | 可選,用於結果的 JSON Schema |
| `permissionLevel` | `string` | `"user"`、`"org_member"`、`"org_admin"`、`"system"` |
| `requiresApproval` | `boolean` | 若為 true,執行前需用戶批准 |

## 校驗

工具名稱必須匹配 `/^[a-z0-9_]+$/`。凡是暗示代碼執行、Shell 訪問或其他敏感操作的名稱,都會在審核階段被拒絕。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.