INNER CODE UNIT · Python
_handle_tools_list
stevesolun/ctx · src/ctx/mcp_server/server.py:163
def _handle_tools_list(state: _ServerState, params: dict[str, Any]) -> dict[str, Any]:
"""Return the ctx-core tool catalogue in MCP schema."""
toolbox = state.ensure_toolbox()
tools: list[dict[str, Any]] = []
for td in toolbox.tool_definitions():
tools.append(
{
"name": td.name,
"description": td.description,
"inputSchema": td.parameters,
}
)
return {"tools": tools}
def _handle_tools_call(state: _ServerState, params: dict[str, Any]) -> dict[str, Any]:
"""Execute one tool call.