Class ToolNodes

java.lang.Object
com.google.adk.workflow.ToolNodes

@Experimental public final class ToolNodes extends Object
Static factories for workflow nodes that run a BaseTool, such as an MCP tool or an agent wrapped as a tool. A node calls its tool between the plugins' tool callbacks and keeps only the tool's state and artifact changes; a tool declared to return nothing gives no output. A tool that asks for confirmation does not pause the workflow: the node outputs the tool's placeholder error.
  • Method Details

    • asNode

      public static Node asNode(BaseTool tool)
      Returns a node named after tool, with the default NodeConfig. Otherwise it behaves as asNode(BaseTool, String, NodeConfig) describes.
    • asNode

      public static Node asNode(BaseTool tool, String name)
      Returns a node named name that runs tool, with the default NodeConfig. Otherwise it behaves as asNode(BaseTool, String, NodeConfig) describes.
    • asNode

      public static Node asNode(BaseTool tool, String name, NodeConfig config)
      Returns a node named name that runs tool with config; session state supplies any required parameter that the input lacks. The input may be a map of arguments; an object the JSON mapper writes as a JSON object, such as a record; a JSON object as text or as a Content; or null or blank text for none. A tool with one parameter, or one required parameter, takes any other input as that parameter; other tools fail.