Skip to content

When trying to call MCPToolbox on Cloud run I get Failed to validate and cache the new token: Token used too early #332

@jeff-got

Description

@jeff-got

Prerequisites

  • I've searched the current open issues
  • I've updated to the latest version of Toolbox
  • I've updated to the latest version of the SDK

Toolbox version

us-central1-docker.pkg.dev/database-toolbox/toolbox/toolbox:latest

Environment

  1. OS type and version: Linux penguin 6.6.76-08174-g2f3b34fb3650
  2. How are you running Toolbox:
  • As a container (e.g. from us-central1-docker.pkg.dev/database-toolbox/toolbox/toolbox:$VERSION)
  1. Python version - 3.11.2
  2. pip version - pip 25.1.1

Client

  1. Client: google-adk=1.10.0
  2. Version:
  • toolbox-core version 0.4.0
  • google-adk 1.10.0
  1. Example: If possible, please include your code of configuration:
from toolbox_core import ToolboxSyncClient, auth_methods
from google.adk.agents import Agent
from .prompt import agent_instruction

URL = "https://**************.run.app"

auth_token_provider = auth_methods.get_google_id_token(URL)

toolbox = ToolboxSyncClient(
    URL,
    client_headers={"Authorization": auth_token_provider},
)

toolbox_tools = toolbox.load_toolset("project_toolset")

root_agent = Agent(
    model="gemini-2.0-flash-001",
    name="test_agent",
    instruction=agent_instruction,
    tools=[toolbox_tools]
)

Expected Behavior

That the agent is able to authenticate correctly and the BigQuery data is returned to the agent

Current Behavior

the following error is returned
Failed to validate and cache the new token: Token used too early, 1754647350 < 1754647352. Check that your computer's clock is set correctly

Steps to reproduce?

  1. create toolset
  2. create agent
  3. run adk web
  4. query agent

Additional Details

No response

Metadata

Metadata

Assignees

Labels

type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions