ADK (v1.0.1)

toolbox_adk.client

ToolboxClient Objects

class ToolboxClient()

Wraps toolbox_core.ToolboxClient to provide ADK-native authentication strategy support.

__init__

def __init__(server_url: str,
             credentials: Optional[CredentialConfig] = None,
             additional_headers: Optional[Dict[str, Union[str, Callable[
                 [], str], Callable[[], Awaitable[str]]]]] = None,
             telemetry_enabled: bool = False,
             **kwargs: Any)

Arguments:

  • server_url - The URL of the Toolbox server.
  • credentials - The CredentialConfig object (from CredentialStrategy).
  • additional_headers - Dictionary of headers (static or dynamic callables).
  • telemetry_enabled - Whether to enable OpenTelemetry tracing and metrics. (Default: False)
  • **kwargs - Additional arguments passed to toolbox_core.ToolboxClient.

toolbox_adk.tool

ToolboxTool Objects

class ToolboxTool(BaseTool)

A tool that delegates to a remote Toolbox tool, integrated with ADK.

__init__

def __init__(core_tool: CoreToolboxTool,
             auth_config: Optional[CredentialConfig] = None,
             adk_token_getters: Optional[Mapping[str, Any]] = None)

Arguments:

  • core_tool - The underlying toolbox_core.py tool instance.
  • auth_config - Credential configuration to handle interactive flows.
  • adk_token_getters - Tool-specific auth token getters.

bind_params

def bind_params(bounded_params: Dict[str, Any]) -> "ToolboxTool"

Allows runtime binding of parameters, delegating to core tool.

toolbox_adk.toolset

ToolboxToolset Objects

class ToolboxToolset(BaseToolset)

A Toolset that provides tools from a remote Toolbox server.

__init__

def __init__(server_url: str,
             toolset_name: Optional[str] = None,
             tool_names: Optional[List[str]] = None,
             credentials: Optional[CredentialConfig] = None,
             additional_headers: Optional[Dict[str, Union[str, Callable[
                 [], str], Callable[[], Awaitable[str]]]]] = None,
             bound_params: Optional[Mapping[str, Union[Callable[[], Any],
                                                       Any]]] = None,
             auth_token_getters: Optional[Mapping[
                 str,
                 Union[
                     Callable[[], str],
                     Callable[[], Awaitable[str]],
                     Callable[[ToolContext], str],
                     Callable[[ToolContext], Awaitable[str]],
                 ],
             ]] = None,
             **kwargs: Any)

Arguments:

  • server_url - The URL of the Toolbox server.
  • toolset_name - The name of the remote toolset to load.
  • tool_names - Specific tool names to load (alternative to toolset_name).
  • credentials - Authentication configuration.
  • additional_headers - Extra headers (static or dynamic).
  • bound_params - Parameters to bind globally to loaded tools.
  • auth_token_getters - Mapping of auth service names to token getters.

get_tools

@override
async def get_tools(
        readonly_context: Optional[ReadonlyContext] = None) -> List[BaseTool]

Loads tools from the toolbox server and wraps them.

toolbox_adk.credentials

CredentialStrategy Objects

class CredentialStrategy()

Factory for creating credential configurations for ToolboxToolset.

toolbox_identity

@staticmethod
def toolbox_identity() -> CredentialConfig

No credentials are sent. Relies on the remote Toolbox server’s own identity.

workload_identity

@staticmethod
def workload_identity(target_audience: str) -> CredentialConfig

Uses the agent ADC to generate a Google-signed ID token for the specified audience. This is suitable for Cloud Run, GKE, or local development with gcloud auth login.

application_default_credentials

@staticmethod
def application_default_credentials(target_audience: str) -> CredentialConfig

Alias for workload_identity.

user_identity

@staticmethod
def user_identity(client_id: str,
                  client_secret: str,
                  scopes: Optional[List[str]] = None,
                  header_name: Optional[str] = None) -> CredentialConfig

Configures the ADK-native interactive 3-legged OAuth flow to get consent and credentials from the end-user at runtime.

manual_token

@staticmethod
def manual_token(token: str, scheme: str = "Bearer") -> CredentialConfig

Send a hardcoded token string in the Authorization header.

manual_credentials

@staticmethod
def manual_credentials(
        credentials: google_creds.Credentials) -> CredentialConfig

Uses a provided Google Auth Credentials object.

api_key

@staticmethod
def api_key(key: str, header_name: str = "X-API-Key") -> CredentialConfig

Configures an API Key to be sent in a specific header.

from_adk_auth_config

@staticmethod
def from_adk_auth_config(auth_config: AuthConfig) -> CredentialConfig

Creates a CredentialConfig from an ADK AuthConfig object.

Arguments:

  • auth_config - The ADK AuthConfig object.

Returns:

  • CredentialConfig - The corresponding credential configuration.

from_adk_credentials

@staticmethod
def from_adk_credentials(
        auth_credential: AuthCredential,
        auth_scheme: Optional[AuthScheme] = None) -> CredentialConfig

Creates a CredentialConfig from ADK AuthScheme and AuthCredential objects.

Arguments:

  • auth_credential - The ADK AuthCredential (containing secrets/tokens).
  • auth_scheme - The ADK AuthScheme (e.g. OAuth2, HTTP, API Key etc). Required for API Key credentials. Optional for others.

Returns:

  • CredentialConfig - The corresponding credential configuration.

Raises:

  • ValueError - If the credential type is not supported or required scheme is missing.