@@ -45,7 +45,7 @@ func (h *APIHandlers) RegisterRoutes(mux *http.ServeMux /* or other router type
4545 // For now, demonstrating basic registration.
4646
4747 // Health check endpoint
48- mux .HandleFunc ("GET /api/health" , func (w http.ResponseWriter , r * http.Request ) {
48+ mux .HandleFunc ("GET /api/health" , func (w http.ResponseWriter , _ * http.Request ) {
4949 w .Header ().Set ("Content-Type" , "application/json" )
5050 w .WriteHeader (http .StatusOK )
5151 _ , _ = w .Write ([]byte (`{"status":"ok"}` ))
@@ -117,7 +117,7 @@ func (h *APIHandlers) AddMCPServer(w http.ResponseWriter, r *http.Request) {
117117}
118118
119119// ListMCPServers handles GET /api/mcp/servers
120- func (h * APIHandlers ) ListMCPServers (w http.ResponseWriter , r * http.Request ) {
120+ func (h * APIHandlers ) ListMCPServers (w http.ResponseWriter , _ * http.Request ) {
121121 servers , err := h .backendService .ListMCPServers ()
122122 if err != nil {
123123 h .logger .Error ().Err (err ).Msg ("Error listing MCP servers via API" )
@@ -268,21 +268,21 @@ func (h *APIHandlers) RemoveMCPServer(w http.ResponseWriter, r *http.Request) {
268268
269269// ListTools handles GET /api/mcp/tools
270270func (h * APIHandlers ) ListTools (w http.ResponseWriter , r * http.Request ) {
271- // Get server ID from query parameter if provided
271+ // Parse server ID from query parameter if provided
272272 serverIDStr := r .URL .Query ().Get ("server_id" )
273273
274274 if serverIDStr != "" {
275- // If server ID is provided, get tools for that server
276- serverID , parseErr := strconv .ParseInt (serverIDStr , 10 , 64 )
277- if parseErr != nil {
275+ // List tools for a specific server
276+ serverID , err := strconv .ParseInt (serverIDStr , 10 , 64 )
277+ if err != nil {
278278 http .Error (w , "Invalid server_id parameter" , http .StatusBadRequest )
279279 return
280280 }
281281
282282 // Check if server exists
283- server , serveErr := h .backendService .GetMCPServer (serverID )
284- if serveErr != nil {
285- h .logger .Error ().Err (serveErr ).Int64 ("serverId" , serverID ).Msg ("Error checking server for tools listing " )
283+ server , err := h .backendService .GetMCPServer (serverID )
284+ if err != nil {
285+ h .logger .Error ().Err (err ).Int64 ("serverId" , serverID ).Msg ("Error checking server for tools list " )
286286 http .Error (w , "Failed to check server existence" , http .StatusInternalServerError )
287287 return
288288 }
@@ -296,12 +296,12 @@ func (h *APIHandlers) ListTools(w http.ResponseWriter, r *http.Request) {
296296 h .logger .Info ().Int64 ("serverId" , serverID ).Msg ("Listing tools for server is not yet implemented" )
297297 http .Error (w , "Listing tools by server is not implemented yet" , http .StatusNotImplemented )
298298 return
299- } else {
300- // Get all tools - not implemented yet
301- h .logger .Info ().Msg ("Listing all tools is not yet implemented" )
302- http .Error (w , "Listing all tools is not implemented yet" , http .StatusNotImplemented )
303- return
304299 }
300+
301+ // Get all tools - not implemented yet
302+ h .logger .Info ().Msg ("Listing all tools is not yet implemented" )
303+ http .Error (w , "Listing all tools is not implemented yet" , http .StatusNotImplemented )
304+ return
305305}
306306
307307// RediscoverTools handles POST /api/mcp/rediscover-tools
@@ -359,7 +359,7 @@ func (h *APIHandlers) RediscoverTools(w http.ResponseWriter, r *http.Request) {
359359}
360360
361361// HandleConfigExport handles the config export API endpoint
362- func (h * APIHandlers ) HandleConfigExport (w http.ResponseWriter , r * http.Request ) {
362+ func (h * APIHandlers ) HandleConfigExport (w http.ResponseWriter , _ * http.Request ) {
363363 jsonData , err := h .configExporter .GenerateConfigJSON ()
364364 if err != nil {
365365 h .logger .Error ().Err (err ).Msg ("Failed to generate config JSON" )
0 commit comments