Feature hasn't been suggested before.
Describe the enhancement you want to request
The tool.definition hook currently receives only { toolID: string } as input. Plugins that provide tools have no way to know which model or agent will use those tools, and lack session context, making it impossible to adapt tool descriptions or parameters based on model capabilities or session state.
Use case: Plugins providing advanced code exploration tools (symbol zoom, call graph navigation, AST pattern matching) alongside simple tools (read, write, edit) need to conditionally simplify or hide tool descriptions for less capable models that waste tokens on failed calls to advanced tools.
Proposed change: Pass sessionID, model ({ providerID, modelID }), and agent info through to the tool.definition hook. The model and agent variables are already in scope at the call site in ToolRegistry.tools(). Refactoring tools() to accept a single input object { model, sessionID, agent? } also makes the API cleaner for future additions.
This supersedes #17334 / #17331 by including sessionID alongside model and agent in a single change.
Operating System
macOS
Feature hasn't been suggested before.
Describe the enhancement you want to request
The
tool.definitionhook currently receives only{ toolID: string }as input. Plugins that provide tools have no way to know which model or agent will use those tools, and lack session context, making it impossible to adapt tool descriptions or parameters based on model capabilities or session state.Use case: Plugins providing advanced code exploration tools (symbol zoom, call graph navigation, AST pattern matching) alongside simple tools (read, write, edit) need to conditionally simplify or hide tool descriptions for less capable models that waste tokens on failed calls to advanced tools.
Proposed change: Pass
sessionID,model({ providerID, modelID }), andagentinfo through to thetool.definitionhook. Themodelandagentvariables are already in scope at the call site inToolRegistry.tools(). Refactoringtools()to accept a single input object{ model, sessionID, agent? }also makes the API cleaner for future additions.This supersedes #17334 / #17331 by including
sessionIDalongsidemodelandagentin a single change.Operating System
macOS