Skip to content

ScenarioToolDefinition

工具定义接口。

typescript
interface ScenarioToolDefinition {
  name: string
  definition: {
    name: string
    description: string
    descriptionZh?: string
    parameters: {
      type: string
      properties: Record<string, ToolParameter>
      required?: string[]
    }
  }
  executor: ToolExecutor
}

type ToolExecutor = (
  args: Record<string, unknown>,
  context: ToolExecutionContext,
) => Promise<ToolExecutionResult>

interface ToolExecutionResult {
  success: boolean
  data?: unknown
  error?: string
}

详见 工具开发

AweeClaw AI 应用构建平台