Renamed version tool
This commit is contained in:
@@ -326,7 +326,7 @@ async def handle_list_tools() -> list[Tool]:
|
|||||||
tools.extend(
|
tools.extend(
|
||||||
[
|
[
|
||||||
Tool(
|
Tool(
|
||||||
name="get_version",
|
name="version",
|
||||||
description=(
|
description=(
|
||||||
"VERSION & CONFIGURATION - Get server version, configuration details, "
|
"VERSION & CONFIGURATION - Get server version, configuration details, "
|
||||||
"and list of available tools. Useful for debugging and understanding capabilities."
|
"and list of available tools. Useful for debugging and understanding capabilities."
|
||||||
@@ -407,7 +407,7 @@ async def handle_call_tool(name: str, arguments: dict[str, Any]) -> list[TextCon
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
# Route to utility tools that provide server information
|
# Route to utility tools that provide server information
|
||||||
elif name == "get_version":
|
elif name == "version":
|
||||||
logger.info(f"Executing utility tool '{name}'")
|
logger.info(f"Executing utility tool '{name}'")
|
||||||
result = await handle_get_version()
|
result = await handle_get_version()
|
||||||
logger.info(f"Utility tool '{name}' execution completed")
|
logger.info(f"Utility tool '{name}' execution completed")
|
||||||
@@ -633,7 +633,7 @@ async def handle_get_version() -> list[TextContent]:
|
|||||||
"max_context_tokens": "Dynamic (model-specific)",
|
"max_context_tokens": "Dynamic (model-specific)",
|
||||||
"python_version": f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}",
|
"python_version": f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}",
|
||||||
"server_started": datetime.now().isoformat(),
|
"server_started": datetime.now().isoformat(),
|
||||||
"available_tools": list(TOOLS.keys()) + ["get_version"],
|
"available_tools": list(TOOLS.keys()) + ["version"],
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check configured providers
|
# Check configured providers
|
||||||
@@ -669,7 +669,7 @@ Available Tools:
|
|||||||
For updates, visit: https://github.com/BeehiveInnovations/zen-mcp-server"""
|
For updates, visit: https://github.com/BeehiveInnovations/zen-mcp-server"""
|
||||||
|
|
||||||
# Create standardized tool output
|
# Create standardized tool output
|
||||||
tool_output = ToolOutput(status="success", content=text, content_type="text", metadata={"tool_name": "get_version"})
|
tool_output = ToolOutput(status="success", content=text, content_type="text", metadata={"tool_name": "version"})
|
||||||
|
|
||||||
return [TextContent(type="text", text=tool_output.model_dump_json())]
|
return [TextContent(type="text", text=tool_output.model_dump_json())]
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class TestServerTools:
|
|||||||
assert "chat" in tool_names
|
assert "chat" in tool_names
|
||||||
assert "precommit" in tool_names
|
assert "precommit" in tool_names
|
||||||
assert "testgen" in tool_names
|
assert "testgen" in tool_names
|
||||||
assert "get_version" in tool_names
|
assert "version" in tool_names
|
||||||
|
|
||||||
# Should have exactly 8 tools (including testgen)
|
# Should have exactly 8 tools (including testgen)
|
||||||
assert len(tools) == 8
|
assert len(tools) == 8
|
||||||
@@ -73,9 +73,9 @@ class TestServerTools:
|
|||||||
assert "Claude's Turn" in response_data["content"]
|
assert "Claude's Turn" in response_data["content"]
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_handle_get_version(self):
|
async def test_handle_version(self):
|
||||||
"""Test getting version info"""
|
"""Test getting version info"""
|
||||||
result = await handle_call_tool("get_version", {})
|
result = await handle_call_tool("version", {})
|
||||||
assert len(result) == 1
|
assert len(result) == 1
|
||||||
|
|
||||||
response = result[0].text
|
response = result[0].text
|
||||||
|
|||||||
Reference in New Issue
Block a user