MCPcopy Create free account
hub / github.com/IBM/mcp-cli / DummyRegistry

Class DummyRegistry

tests/tools/test_tool_manager.py:26–42  ·  view source on GitHub ↗

Stub registry that satisfies the async interface ToolManager expects.

Source from the content-addressed store, hash-verified

24
25
26class DummyRegistry:
27 """Stub registry that satisfies the async interface ToolManager expects."""
28
29 def __init__(self, items: List[Tuple[str, str]]):
30 # items is a list of ``(namespace, name)`` pairs
31 self._items = items
32 self._meta: Dict[Tuple[str, str], DummyMeta] = {}
33
34 # ------------------------------------------------------------------ #
35 # Async API expected by ToolManager
36 # ------------------------------------------------------------------ #
37 async def list_tools(self):
38 # Return ToolInfo objects instead of tuples
39 return [RegistryToolInfo(namespace=ns, name=name) for ns, name in self._items]
40
41 async def get_metadata(self, name, ns):
42 return self._meta.get((ns, name))
43
44
45@pytest.fixture

Callers 1

managerFunction · 0.85

Calls

no outgoing calls

Tested by 1

managerFunction · 0.68