We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/MacroSense-AI/dietician-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
handler.py•508 B
from typing import Any
from mcp.types import TextContent
from .functions.sum import add_numbers
# Tool dispatcher
async def handle_tool_call(name: str, arguments: dict[str, Any]) -> list[TextContent]:
"""Handle tool calls by dispatching to the appropriate handler."""
if name == "add_numbers":
result = await add_numbers(
arguments.get("number1", 0),
arguments.get("number2", 0)
)
return result
raise ValueError(f"Unknown tool: {name}")