opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(tool): add tool_search for dynamic tool discovery

Open sandipwane opened this issue 3 weeks ago • 2 comments

Adds a new tool_search tool that allows the LLM to search for available tools by name or description using regex patterns. This is the first step toward reducing context window usage when many tools are available.

Relates to #2418

What does this PR do?

How did you verify your code works?

sandipwane avatar Jan 14 '26 22:01 sandipwane

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

github-actions[bot] avatar Jan 14 '26 22:01 github-actions[bot]

The following comment was made by an LLM, it may be inaccurate:

Based on my search results, I found one potentially related PR:

PR #7271: feat(agent): add subagents config for per-agent task tool filtering

  • https://github.com/anomalyco/opencode/pull/7271

Why it might be related: This PR also addresses tool management and context optimization (filtering tools to reduce context window), though it takes a different approach through per-agent configuration rather than dynamic search. Both relate to managing tool availability and context window usage.

Otherwise, no other duplicate PRs were found for the tool_search feature itself.

github-actions[bot] avatar Jan 14 '26 22:01 github-actions[bot]