MCPcopy Index your code
hub / github.com/IBM/AssetOpsBench / _coerce_tool_input

Function _coerce_tool_input

src/agent/opencode_agent/runner.py:270–281  ·  view source on GitHub ↗
(value: Any)

Source from the content-addressed store, hash-verified

268
269
270def _coerce_tool_input(value: Any) -> dict[str, Any]:
271 if isinstance(value, dict):
272 return value
273 if isinstance(value, str):
274 try:
275 parsed = json.loads(value)
276 except json.JSONDecodeError:
277 return {"raw": value}
278 return parsed if isinstance(parsed, dict) else {"value": parsed}
279 if value is None:
280 return {}
281 return {"value": value}
282
283
284def _walk_dicts(value: Any):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected