Visitar URL original
fix(toolbox-core): load_toolset(strict=True) rejects fully used auth tokens and bound params · Issue #734 · googleapis/mcp-toolbox-sdk-python · GitHub
Skip to content

fix(toolbox-core): load_toolset(strict=True) rejects fully used auth tokens and bound params #734

Description

@hsusul

Summary

ToolboxClient.load_toolset(..., strict=True) incorrectly fails when every provided bound parameter / auth token is used by every loaded tool. The documented success path is unreachable whenever any auth getters or bound params are supplied.

Affected Area

  • packages/toolbox-core/src/toolbox_core/client.py (ToolboxClient.load_toolset)
  • Sync wrapper inherits the bug via ToolboxSyncClient.load_toolset

Repro

# Mocked transport returning a single tool that declares param_P.
await client.load_toolset(
    bound_params={"param_P": "some_value"},
    strict=True,
)

Actual

ValueError: Validation failed for toolset 'default': unused bound parameters could not be applied to any tool: param_P.

Expected

Per the strict docstring: raise only when any loaded tool fails to utilize all provided parameters/tokens. When every tool uses them, loading should succeed.

Root cause

In the per-tool loop, overall_used_auth_keys / overall_used_bound_params are updated only in the else (non-strict) branch. The final toolset-level validate_unused_requirements(...) always runs afterward with empty overall-used sets under strict=True, so every provided key looks unused.

Why this matters

Callers who enable strict=True to enforce per-tool completeness of shared bound params / auth tokens cannot successfully load an otherwise valid toolset.

Activity

  1. anubhav756 commented on Jul 27, 2026

    @anubhav756
    Contributor

    Thanks for raising the PR @hsusul! Really helpful.

    Just added a couple of small thoughts to the PR. Appreciate if you could look at those as well :)

    Also, maybe you might want to sign the CLA to get the presubmits green? https://github.com/googleapis/mcp-toolbox-sdk-python/pull/735/checks?check_run_id=89598482186

  2. added
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    on Aug 4, 2026
  3. anubhav756 commented on Sep 8, 2026

    @anubhav756
    Contributor

    Haven't been able to get to this one yet. Will take a closer look soon! Thanks again for bearing with us @hsusul !

  4. anubhav756 commented on Sep 29, 2026

    @anubhav756
    Contributor

    Hi @hsusul , apologies for the delay on this one, and thanks for your patience! This is approved.

    Could you please rebase onto main? While you're there, #779 introduced overall_used_secure_params, which has the same issue. It's only updated in the non-strict branch. Could you apply the same fix to it and add a strict=True test with secure_params? Happy to merge once that's in. Thanks!

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

Metadata

Metadata

Assignees

Labels

priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions