MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / call_tool

Function call_tool

src/codegraphcontext/api/router.py:61–89  ·  view source on GitHub ↗
(
    request: ToolCallRequest,
    server: MCPServer = Depends(get_server)
)

Source from the content-addressed store, hash-verified

59
60@router.post("/tools/call", response_model=ApiResponse)
61async def call_tool(
62 request: ToolCallRequest,
63 server: MCPServer = Depends(get_server)
64):
65 try:
66 result = await server.handle_tool_call(
67 request.name,
68 request.arguments
69 )
70
71 if "error" in result:
72 return ApiResponse(
73 status="error",
74 error=result["error"]
75 )
76
77 return ApiResponse(
78 status="ok",
79 data=result
80 )
81
82 except (OSError, socket.error) as exc:
83 raise_service_unavailable(exc)
84
85 except Exception as e:
86 return ApiResponse(
87 status="error",
88 error=str(e)
89 )
90
91
92@router.post("/index", response_model=ApiResponse)

Callers

nothing calls this directly

Calls 3

ApiResponseClass · 0.85
handle_tool_callMethod · 0.45

Tested by

no test coverage detected