mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-13 07:13:20 +08:00
Make tool failures actionable with suggestions and scope hints.
Unregistered tools now suggest close matches; MCP insufficient_scope is rewritten with fallbacks so ops agents stop blind-retrying SQL without sql:query. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
229e8b1368
commit
d245e463c0
6 changed files with 159 additions and 4 deletions
|
|
@ -127,6 +127,9 @@ class _McpBoundTool:
|
|||
return {"ok": False, "error_code": "mcp_runtime_invalid_payload", "error": "invalid_response"}
|
||||
if "ok" not in res:
|
||||
res["ok"] = False
|
||||
from runtime.tools.tool_error_hints import enrich_mcp_scope_error
|
||||
|
||||
res = enrich_mcp_scope_error(res)
|
||||
if tool_name == "listCliTargets" and res.get("ok") is not False and cache_key:
|
||||
_set_list_cli_cache(cache_key, res)
|
||||
res = dict(res)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue