Skip to content

Team.get_agentlet: accept and forward active_mcp_servers#1220

Closed
romans127 wants to merge 2 commits into
PrefectHQ:mainfrom
romans127:fix/team-forward-active-mcp-servers
Closed

Team.get_agentlet: accept and forward active_mcp_servers#1220
romans127 wants to merge 2 commits into
PrefectHQ:mainfrom
romans127:fix/team-forward-active-mcp-servers

Conversation

@romans127

@romans127 romans127 commented Aug 25, 2025

Copy link
Copy Markdown

Summary: Fixes a TypeError when using Team with the orchestrator. The orchestrator passes active_mcp_servers into actor.get_agentlet(...). Agent.get_agentlet supports this parameter, but Team.get_agentlet did not accept or forward it, causing a mismatch.

Changes:

  • Add optional active_mcp_servers: list[MCPServer] | None to Team.get_agentlet signature
  • Forward to self.active_member.get_agentlet(...)
  • Import MCPServer in team.py
  • Add a unit test tests/agents/test_team_mcp_forward.py to assert forwarding without invoking an LLM

Backwards compatibility: Optional parameter only; no breaking changes.

Motivation: Ensures teams work with MCP integration through the orchestrator, aligning Team with Actor/Agent signatures.

Copilot AI review requested due to automatic review settings August 25, 2025 19:47
@github-actions github-actions Bot added the tests label Aug 25, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 addresses a TypeError that occurs when using Team objects with the orchestrator by adding MCP server support to the Team class. The orchestrator passes active_mcp_servers to get_agentlet(), which Agent supports but Team previously did not, causing a signature mismatch.

  • Add active_mcp_servers parameter to Team.get_agentlet() method signature
  • Forward the parameter to the active member's get_agentlet() call
  • Add unit test to verify proper parameter forwarding

Reviewed Changes

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

File Description
src/marvin/agents/team.py Adds MCPServer import and active_mcp_servers parameter to get_agentlet() method with proper forwarding
tests/agents/test_team_mcp_forward.py Adds unit test to verify MCP servers parameter is correctly forwarded to active team member

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

Comment thread tests/agents/test_team_mcp_forward.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@romans127

Copy link
Copy Markdown
Author

Conceded to #1219 identical solution, but handles documentation + examples. Well done 🥇

@romans127 romans127 closed this Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants