(value)
| 60 | |
| 61 | |
| 62 | def _coerce_json_arg(value): |
| 63 | # Some MCP/CLI bridges emit list/int tool args as JSON-encoded strings |
| 64 | # (e.g. ``"[1, 50]"`` instead of ``[1, 50]``). Parity with the |
| 65 | # pydantic-ai tool path; see _coerce_json_string in str_replace_editor.py. |
| 66 | if isinstance(value, str): |
| 67 | try: |
| 68 | return json.loads(value) |
| 69 | except ValueError: |
| 70 | pass |
| 71 | return value |
| 72 | |
| 73 | |
| 74 | class CawToolKit( |