Complete toolkit for configuring and extending OpenCode: agent creation, custom slash commands, configuration management, plugin development, and SDK usage.
75
94%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
A user wants to create an OpenCode plugin that adds a custom tool called "jira-lookup" that the AI can invoke to look up JIRA ticket details. The tool should accept a "ticket_id" argument (string) and return the ticket summary as a string.
Show how to implement this plugin with the custom tool definition, including proper schema validation.
tool key in the returned hooks object — not via client.registerTool()tool helper from @opencode-ai/pluginticket_id argument using tool.schema.string() (or a Zod equivalent) for schema validation.describe() call to the ticket_id schema fieldexecute function that returns a string valuetool: { 'jira-lookup': tool({...}) } in returned hooks, NOT client.registerTool()tool from @opencode-ai/plugintool.schema.string() (or Zod equivalent) for the ticket_id argument.describe() callclient.registerTool() instead of the tool key in the hooks objecttool from a package other than @opencode-ai/pluginticket_id argument without any schema validation.describe() from the ticket_id schema fieldexecute function returns an object or void instead of a string