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

Function call_tool

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

Source from the content-addressed store, hash-verified

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