You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Custom tool argument descriptions are not passed to agent, and tool argument schemas aren't actually checked #15956
Custom tools -- tools defined on the user's machine, not within opencode -- do not have their metadata properly passed into the LLM, and do not have the arguments provided during calls actually checked against the schema.
This results in bad tool calls from the LLM, which then go initially unnoticed because the inputs aren't actually checked against the schema.
Plugins
None, just the custom tool provided in bug description
OpenCode version
1.2.16
Steps to reproduce
Create a custom tool in ~/.config/opencode/tools/ with some arguments with descriptions on them
e.g. ~/.config/opencode/tools/search.ts
import{tool}from'@opencode-ai/plugin'exportdefaulttool({description: 'search custom docs',args: {query: tool.schema.string().describe('query to search for'),type: tool.schema.union([tool.schema.literal('regex'),tool.schema.literal('text')]).describe('regex or text mode'),},asyncexecute(){return'ok'},})
Start opencode and have it use this tool, see that it will likely provide an incorrect parameter. Note that there is no error from the zod schema
Ask it what the descriptions for the parameters are, and see that it will hallucinate something. Also note it won't know the correct type, and will report that type should be either a string or string[], rather than what it actually should be: "regex" | "text"
Expected Outcome
When an incorrect value is passed in that violates the schema, the args should actually be checked against the schema and an error shoudl be produced
The description & other metadata should actually be passed to the LLM, so it isn't hallucinating the uses of each field.
Activity
github-actions commentedon Mar 4, 2026
This issue might be a duplicate of existing issues. Please check:
.describe()metadata not being passed to the LLM for custom tools, including a root cause analysis and proposed fix.ashleytowner commentedon Mar 4, 2026
Yes, this really is a duplicate of #4357. I'm gonna close this ticket in favour of that.