Skip to content

Conversation

@adk-bot
Copy link
Collaborator

@adk-bot adk-bot commented Dec 12, 2025

  1. [Feature] Document OpenAPI Toolset enhancements.
    OpenAPIToolset and RestApiTool have been enhanced with new features: header_provider, ssl_verify, and tool_name_prefix.

    Proposed Change:
    In docs/tools-custom/openapi-tools.md, add a new section for advanced configuration.

    Current state:
    The documentation explains the basic usage of OpenAPIToolset.

    Proposed Change:
    Add the following section:

    ## Advanced Configuration
    
    ### Custom Headers with `header_provider`
    
    You can provide a callable to `header_provider` to dynamically add custom headers to every API request. The callable receives the `ReadonlyContext` and should return a dictionary of headers.
    
    ```python
    def my_header_provider(context: ReadonlyContext) -> dict[str, str]:
        return {"X-Request-ID": context.invocation_id}
    
    toolset = OpenAPIToolset(
        spec_dict=openapi_spec,
        header_provider=my_header_provider,
    )

    SSL Certificate Verification with ssl_verify

    You can configure SSL certificate verification for all tools in the toolset using the ssl_verify parameter. This is useful for environments with custom CA certificates.

    toolset = OpenAPIToolset(
        spec_dict=openapi_spec,
        ssl_verify="/path/to/ca.pem",
    )

    Tool Name Prefix with tool_name_prefix

    You can add a prefix to all tool names generated by the toolset using the tool_name_prefix parameter. This is useful for avoiding name collisions when using multiple OpenAPI specs.

    toolset = OpenAPIToolset(
        spec_dict=openapi_spec,
        tool_name_prefix="my_api",
    )
    
    **Reasoning**:
    These new features provide more flexibility and control over the OpenAPI tools, and they should be documented.
    
    **Reference**:
    - `src/google/adk/tools/openapi_tool/openapi_spec_parser/openapi_toolset.py`
    - `src/google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py`
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants