MCPcopy Index your code
hub / github.com/FSoft-AI4Code/CodeWiki / _coerce_json_arg

Function _coerce_json_arg

codewiki/src/be/caw_toolkit.py:62–71  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

60
61
62def _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
74class CawToolKit(

Callers 1

str_replace_editorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected