import CodeEditor from '@/components/CodeEditor' import { Heading } from '@/components/Heading' import { useLanguage } from '@/i18n/context' export default function CustomTools() { const { isZh } = useLanguage() return (

{isZh ? '自定义工具' : 'Custom Tools'}

{isZh ? '通过注册自定义工具,扩展 AI Agent 的能力边界。使用 Zod 定义输入接口,让 AI 安全调用你的业务逻辑。' : 'Extend AI Agent capabilities by registering custom tools. Define input schemas with Zod for safe business logic invocation.'}

{isZh ? 'Zod 版本' : 'Zod Version'}

{isZh ? 'Page Agent 使用 Zod 定义工具的输入 schema。支持 Zod 3 (>=3.25.0) 和 Zod 4,请从 zod/v4 子路径导入。不支持 Zod Mini。' : 'Page Agent uses Zod for tool input schemas. Both Zod 3 (>=3.25.0) and Zod 4 are supported. Always import from the zod/v4 subpath. Zod Mini is not supported.'}

=3.25.0) or Zod 4 import { z } from 'zod/v4'`} language="javascript" />
{isZh ? '定义工具' : 'Define Tools'}

{isZh ? '使用 tool() 辅助函数定义自定义工具,每个工具包含 description、inputSchema 和 execute 三个属性。' : 'Use the tool() helper to define custom tools with description, inputSchema, and execute.'}

{isZh ? '覆盖与移除内置工具' : 'Override & Remove Built-in Tools'}

{isZh ? '使用相同的名称可以覆盖内置工具的行为,设置为 null 则完全移除该工具。' : 'Use the same name to override a built-in tool, or set it to null to remove it entirely.'}

) }