Skip to content

Work on Tool Wrappers#1548

Merged
rumpl merged 8 commits intodocker:mainfrom
dgageot:wrappers
Feb 2, 2026
Merged

Work on Tool Wrappers#1548
rumpl merged 8 commits intodocker:mainfrom
dgageot:wrappers

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Jan 31, 2026

No description provided.

@dgageot dgageot requested a review from a team as a code owner January 31, 2026 08:54
Add StartableToolSet to pkg/tools for managing toolset lifecycle with
lazy, single-flight start semantics. This is preparatory work for moving
the wrapper out of the agent package.

Add generic As[T] helper that unwraps StartableToolSet before type
assertion, enabling clean capability checking without knowing wrapper
details.

Assisted-By: cagent
Add Instructable, Elicitable, OAuthCapable, and PromptProvider interfaces
that toolsets can optionally implement. This enables interface segregation
where the core ToolSet interface stays minimal while specialized features
are opt-in.

Add GetInstructions helper that uses As[T] for clean capability checking.

Assisted-By: cagent
Add ConfigureHandlers that configures elicitation and OAuth handlers on
toolsets that support them, using As[T] for capability checking. This
reduces boilerplate in runtime when setting up toolset handlers.

Assisted-By: cagent
…Set interface

This commit combines the migration of StartableToolSet from the agent package
to the tools package, along with cleaning up the ToolSet interface.

Changes:
- Move StartableToolSet from agent package to tools package
- Add tools.As[T] generic helper for type assertions with automatic unwrapping
- Add capability interfaces (Instructable, Elicitable, OAuthCapable)
- Add tools.ConfigureHandlers convenience function
- Add compile-time interface assertions for MCP toolset
- Update runtime to use tools.As[T] instead of UnwrapMCPToolset
- Update app to use tools.As[T] for MCP toolset type assertion
- Remove MCP-specific methods from ToolSet interface (now opt-in via capabilities)
- Update DescriptionToolSet to use capability checking

Assisted-By: cagent
Signed-off-by: David Gageot <david.gageot@docker.com>
Signed-off-by: David Gageot <david.gageot@docker.com>
Move description parameter handling from a wrapper struct to a simple
function called at tool retrieval time. This eliminates the need for
DescriptionToolSet to implement all capability interfaces (Startable,
Instructable, Elicitable, OAuthCapable) just to forward calls.

Changes:
- Add addDescriptionParameter field to Agent struct
- Add WithAddDescriptionParameter option
- Add tools.AddDescriptionParameter function to transform tool lists
- Remove DescriptionToolSet wrapper entirely
- Apply transformation in agent.Tools() when flag is enabled

Assisted-By: cagent
Signed-off-by: David Gageot <david.gageot@docker.com>
@rumpl rumpl merged commit ffe8b84 into docker:main Feb 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants