JC321 commited on
Commit
9fc18d6
·
verified ·
1 Parent(s): 505e3a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -166,7 +166,11 @@ def call_mcp_tool(tool_name, arguments):
166
  )
167
 
168
  if response.status_code == 200:
169
- return response.json()
 
 
 
 
170
  else:
171
  return {"error": f"HTTP {response.status_code}", "detail": response.text[:200]}
172
  except Exception as e:
 
166
  )
167
 
168
  if response.status_code == 200:
169
+ data = response.json()
170
+ # 解包 JSON-RPC 响应,只返回 result 字段给模型
171
+ if isinstance(data, dict) and "result" in data:
172
+ return data["result"]
173
+ return data
174
  else:
175
  return {"error": f"HTTP {response.status_code}", "detail": response.text[:200]}
176
  except Exception as e: