result.py
TEXT FILE724 B · Public source code for developers, search crawlers and AI agents
1import json
2
3def tool_result(http_status, envelope):
4 # Minimal disclosure: do not forward raw wallet metadata or errors.
5 if (http_status != 200 or not isinstance(envelope, dict)
6 or envelope.get("ok") is not True
7 or not isinstance(envelope.get("result"), dict)):
8 return {"content": [{"type": "text", "text": "Balance query failed or unavailable."}],
9 "isError": True}
10 return {"content": [{"type": "text", "text": "Balance query succeeded; inspect authorized result locally."}],
11 "isError": False}
12
13if __name__ == "__main__":
14 # Synthetic response, not a live engine result.
15 print(json.dumps(tool_result(200, {"ok": True, "result": {}}), indent=2))Read-only source · Select a line number to link directly · Raw download above
