Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/switch_core/bridges/agent/mcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async def on_call_tool(self, context: MiddlewareContext, call_next): # type: ig
# Every operation, registered as a tool. This loop is the only thing that makes
# an operation an MCP tool, so the two surfaces cannot diverge.
for _op in all_operations().values():
mcp.tool(_op.fn)
mcp.tool(_op.fn, description=_op.description)

logger.debug("Registered %d operations as MCP tools", len(all_operations()))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import pytest

from switch_core.bridges.agent.mcp.server import mcp
from switch_core.bridges.agent.operations import all_operations

TASK_PROTOCOL_TOOLS = {
"delegate_task",
Expand Down Expand Up @@ -87,6 +88,14 @@ async def test_documented_tools_exist(tool_names: set[str]) -> None:
)


async def test_tool_descriptions_preserve_the_full_operation_contract() -> None:
tools = {tool.name: tool for tool in await mcp.list_tools()}
operation = all_operations()["list_agents"]

assert tools[operation.name].description == operation.description
assert "Returns:" in tools[operation.name].description


SKILLS = sorted(
(Path(__file__).parents[5] / "connectors").glob("*/skills/switch/SKILL.md")
)
Expand Down
Loading