> ## 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.