Skip to content

bugfix: rm unexpected errlogger param while calling MCPSessionManager (oneliner) #722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

n0npax
Copy link

@n0npax n0npax commented May 14, 2025

Fixes:

_init__
    self._session_manager = MCPSessionManager(
                            ^^^^^^^^^^^^^^^^^^
TypeError: MCPSessionManager.__init__() got an unexpected keyword argument 'errlogger'

with current main: 71bd808 creating an MCP like:

def create_REDACTED_agent():
    """Gets tools from MCP Server."""
    playwright_tools = MCPToolset(
        connection_params=StdioServerParameters(
            command="npx",
            args=[
                "-y",
                "@playwright/mcp@latest",
                #         "--vision"
            ],
        ),
    )
    tools = [playwright_tools, .... redacted]
    redacted_agent = LlmAgent(
      name="redacted_agent",
      model=MODEL,
      tools=tools,
    ...
    return redacted_agent

fails as per:

  File "/Users/redacted/Developer/workspace/redacted/redacted/__init__.py", line 1, in <module>
    from . import agent
  File "/Users/redacted/Developer/workspace/redacted/redacted/agent.py", line 39, in <module>
    redacted_agent = create_redacted_agent()
                  ^^^^^^^^^^^^^^^^^^^^
  File "/Users/redacted/Developer/workspace/redacted/redacted/redacted/agent.py", line 11, in create_redacted_agent
    playwright_tools = MCPToolset(
                       ^^^^^^^^^^^
  File "/Users/redacted/Developer/workspace/redacted/.venv/lib/python3.12/site-packages/google/adk/tools/mcp_tool/mcp_toolset.py", line 89, in __init__
    self._session_manager = MCPSessionManager(
                            ^^^^^^^^^^^^^^^^^^
TypeError: MCPSessionManager.__init__() got an unexpected keyword argument 'errlogger'

and it looks like just orphaned param wasn't properly cleaned up, hence this PR.
you can confirm there is no more occurences of errlogger here: https://github.com/search?q=repo%3Agoogle%2Fadk-python%20errlogger&type=code

@n0npax n0npax changed the title remove unexpected errlogger while calling MCPSessionManager bugfix: rm unexpected errlogger param while calling MCPSessionManager (oneliner) May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant