tool.definition is only called here https://github.com/anomalyco/opencode/blob/4877eccc0d06c747624bf61aaa6f3e65cea9cc8d/packages/opencode/src/tool/registry.ts#L301
MCP tools are loaded here https://github.com/anomalyco/opencode/blob/4877eccc0d06c747624bf61aaa6f3e65cea9cc8d/packages/opencode/src/session/prompt.ts#L447
The tool.definition hook fires exactly once in the entire codebase, and only for tools that come from registry.tools() (built-in + plugin tools). MCP tools bypass it entirely via a separate code path (mcp.tools() → convertMcpTool() → straight into the tool list).
The readme implies that tool searching works for MCP servers also. But, the plugin is functionally useless without it working for mcp servers
tool.definition is only called here https://github.com/anomalyco/opencode/blob/4877eccc0d06c747624bf61aaa6f3e65cea9cc8d/packages/opencode/src/tool/registry.ts#L301
MCP tools are loaded here https://github.com/anomalyco/opencode/blob/4877eccc0d06c747624bf61aaa6f3e65cea9cc8d/packages/opencode/src/session/prompt.ts#L447
The tool.definition hook fires exactly once in the entire codebase, and only for tools that come from registry.tools() (built-in + plugin tools). MCP tools bypass it entirely via a separate code path (mcp.tools() → convertMcpTool() → straight into the tool list).
The readme implies that tool searching works for MCP servers also. But, the plugin is functionally useless without it working for mcp servers