summaryrefslogtreecommitdiffhomepage
path: root/packages/web/src/content/docs/plugins.mdx
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-09-18 05:42:59 -0400
committerDax Raad <[email protected]>2025-09-18 05:42:59 -0400
commit1ffc8be2b6917073902c002fc40bf74dd27cb8de (patch)
treeeb1a5ecee5d455226f961c839b3c6fc461434ec7 /packages/web/src/content/docs/plugins.mdx
parent5f2945ae71dc8d44369a313bc6466c74e991eaf4 (diff)
downloadopencode-1ffc8be2b6917073902c002fc40bf74dd27cb8de.tar.gz
opencode-1ffc8be2b6917073902c002fc40bf74dd27cb8de.zip
rework custom tools
Diffstat (limited to 'packages/web/src/content/docs/plugins.mdx')
-rw-r--r--packages/web/src/content/docs/plugins.mdx8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/web/src/content/docs/plugins.mdx b/packages/web/src/content/docs/plugins.mdx
index 72758e8a3..47f53fddf 100644
--- a/packages/web/src/content/docs/plugins.mdx
+++ b/packages/web/src/content/docs/plugins.mdx
@@ -108,7 +108,7 @@ export const EnvProtection = async ({ project, client, $, directory, worktree })
### Custom tools
-Create custom tools that opencode can use:
+Plugins can also add custom tools to opencode:
```ts title=".opencode/plugin/custom-tools.ts"
import type { Plugin, tool } from "@opencode-ai/plugin"
@@ -116,15 +116,15 @@ import type { Plugin, tool } from "@opencode-ai/plugin"
export const CustomToolsPlugin: Plugin = async (ctx) => {
return {
tool: {
- mytool: tool((zod) => ({
+ mytool: tool({
description: "This is a custom tool",
args: {
- foo: zod.string(),
+ foo: tool.schema.string(),
},
async execute(args, ctx) {
return `Hello ${args.foo}!`
},
- })),
+ }),
},
}
}