# Class ToolConverter

java.lang.Object
com.google.adk.models.springai.ToolConverter

public class ToolConverter extends Object
Converts between ADK and Spring AI tool/function formats.

This converter handles the translation between ADK's BaseTool/FunctionDeclaration format and Spring AI tool representations. This is a simplified initial version that focuses on basic schema conversion and tool metadata handling.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `ToolConverter.ToolMetadata`
  Simple metadata holder for tool information.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ToolConverter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Map<String,Object>`
  `convertSchemaToSpringAi(com.google.genai.types.Schema schema)`
  Converts ADK Schema to Spring AI compatible parameter schema.
  `List<org.springframework.ai.tool.ToolCallback>`
  `convertToSpringAiTools(Map<String,BaseTool> tools)`
  Converts ADK tools to Spring AI ToolCallback format for tool calling.
  `Map<String, ToolConverter.ToolMetadata>`
  `createToolRegistry(Map<String,BaseTool> tools)`
  Creates a tool registry from ADK tools for internal tracking.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ToolConverter

    public ToolConverter()

- ## Method Details

  - ### createToolRegistry

    public Map<String, ToolConverter.ToolMetadata> createToolRegistry(Map<String,BaseTool> tools)
    Creates a tool registry from ADK tools for internal tracking.

    This method provides a way to track available tools, though Spring AI tool calling integration will be enhanced in subsequent iterations.

    Parameters:
      `tools` - Map of ADK tools to process
    Returns:
      Map of tool names to their metadata

  - ### convertSchemaToSpringAi

    public Map<String,Object> convertSchemaToSpringAi(com.google.genai.types.Schema schema)
    Converts ADK Schema to Spring AI compatible parameter schema.

    This provides basic schema conversion for tool parameters.

    Parameters:
      `schema` - The ADK schema to convert
    Returns:
      A Map representing the Spring AI compatible schema

  - ### convertToSpringAiTools

    public List<org.springframework.ai.tool.ToolCallback> convertToSpringAiTools(Map<String,BaseTool> tools)
    Converts ADK tools to Spring AI ToolCallback format for tool calling.
    Parameters:
      `tools` - Map of ADK tools to convert
    Returns:
      List of Spring AI ToolCallback objects