adk-go icon indicating copy to clipboard operation
adk-go copied to clipboard

Finalize tool.Tool interface

Open dpasiukevich opened this issue 1 month ago • 3 comments

Currently is serves as a placeholder type to pass tools to LLMAgent.

It's not possible to implement tool.Tool directly with a custom type (technically possible, but this tool won't work). The only way right now to create tool -- using adk-provided constructors (e.g. functiontool.New, loadartifacttool.New).

We need to finalize tool.Tool interface (and maybe even expose any extra interfaces if needed), to allow standard implicit interface implementation of a tool by custom types.

dpasiukevich avatar Nov 14 '25 12:11 dpasiukevich

This is an important interface design consideration. Making tool.Tool interface more flexible would definitely help with custom tool implementations.

A few thoughts:

  • Exposing the interface could allow for better composition patterns and reduce boilerplate
  • Consider adding helper methods or validation utilities to make custom tool creation easier
  • Documentation with clear examples of implementing custom tools would be valuable

I'd be happy to help test any proposed changes or contribute to documentation once the interface is finalized.

shanto12 avatar Nov 15 '25 14:11 shanto12

One question I have is if tools can have access to the services like ArtifactService. Will the new interface allow us to implement a custom tool like read_file the loads a file from the user device to the artifacts so our agents can access it?

verdverm avatar Nov 22 '25 21:11 verdverm