Skip to content

Conversation

@zzstoatzz
Copy link
Collaborator

Summary

  • Fixed Team.get_agentlet() method signature to accept the active_mcp_servers parameter
  • This parameter was added to support MCP servers but was missing from the Team class implementation
  • Resolves TypeError when using teams in environments with MCP servers enabled

The Issue

The Teams/Swarm feature was broken due to a signature mismatch. When MCP server support was added to the Agent class, the Team.get_agentlet() method wasn't updated to accept the new active_mcp_servers parameter, causing a TypeError.

The Fix

Updated Team.get_agentlet() to:

  1. Accept the active_mcp_servers parameter in its signature
  2. Pass it through to the active member's get_agentlet() call

Test Plan

  • All existing team tests pass (uv run pytest tests/basic/actors/test_team.py)
  • API documentation automatically updated by pre-commit hook

Fixes #1218

🤖 Generated with Claude Code

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Aug 25, 2025
The Team class was missing the active_mcp_servers parameter that was added
to support MCP servers in the Agent class. This caused a TypeError when
teams were used in environments with MCP servers enabled.

Fixes #1218

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a method signature incompatibility in the Team class that was causing TypeErrors when using teams in environments with MCP servers enabled. The issue arose when MCP server support was added to the Agent class but the Team class wasn't updated accordingly.

  • Added active_mcp_servers parameter to Team.get_agentlet() method signature
  • Updated the method to pass the parameter through to the active member's get_agentlet() call
  • Added comprehensive test coverage for the new functionality

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/marvin/agents/team.py Added active_mcp_servers parameter to method signature and pass-through logic
tests/basic/actors/test_team.py Added test case to verify proper handling of MCP servers parameter
examples/hello_team.py Added example demonstrating Teams functionality
docs/api-reference/marvin-agents-team.mdx Updated API documentation to reflect new method signature

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

from unittest.mock import AsyncMock, MagicMock

from pydantic_ai.mcp import MCPServer

Copy link

Copilot AI Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Import statements should be placed at the top of the file rather than inside functions for better code organization and consistency.

Suggested change

Copilot uses AI. Check for mistakes.
@zzstoatzz zzstoatzz merged commit 69b6374 into main Aug 27, 2025
4 checks passed
@zzstoatzz zzstoatzz deleted the fix-team-mcp-servers branch August 27, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation example tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Marvin Teams/Swarm feature is currently broken (~3.1.5)

2 participants