mcp
This commit is contained in:
31
scripts/mcp-server/tests/test_tools.py
Normal file
31
scripts/mcp-server/tests/test_tools.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""Tool registry tests."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from mcp_server import tools
|
||||
|
||||
MIN_TOOLS = 5
|
||||
|
||||
|
||||
def test_tool_catalog_has_minimum_tools() -> None:
|
||||
"""Catalog includes baseline tools."""
|
||||
catalog = tools.tool_catalog()
|
||||
assert len(catalog) >= MIN_TOOLS
|
||||
names = {tool.name for tool in catalog}
|
||||
assert "show-constitution" in names
|
||||
assert "list-playbooks" in names
|
||||
assert "show-reference" in names
|
||||
|
||||
|
||||
def test_invoke_tool_handles_unknown() -> None:
|
||||
"""Unknown tool returns unsupported guidance."""
|
||||
result = tools.invoke_tool("missing-tool", {})
|
||||
assert result["status"] == "unsupported"
|
||||
assert "listTools" in result["actions"][0]
|
||||
|
||||
|
||||
def test_list_tools_payload_shape() -> None:
|
||||
"""Payload includes tools key."""
|
||||
payload = tools.list_tools_payload()
|
||||
assert "tools" in payload
|
||||
assert all("name" in entry for entry in payload["tools"])
|
||||
Reference in New Issue
Block a user