Parse raw arguments into a dictionary.
(self, raw_arguments: Any)
| 1246 | return llm_tool_name, raw_arguments, call_id |
| 1247 | |
| 1248 | def _parse_arguments(self, raw_arguments: Any) -> dict[str, Any]: |
| 1249 | """Parse raw arguments into a dictionary.""" |
| 1250 | try: |
| 1251 | if isinstance(raw_arguments, str): |
| 1252 | if not raw_arguments.strip(): |
| 1253 | return {} |
| 1254 | parsed: dict[str, Any] = json.loads(raw_arguments) |
| 1255 | return parsed |
| 1256 | result: dict[str, Any] = raw_arguments or {} |
| 1257 | return result |
| 1258 | except json.JSONDecodeError as e: |
| 1259 | logger.warning(f"Invalid JSON in arguments: {e}") |
| 1260 | return {} |
| 1261 | except Exception as e: |
| 1262 | logger.error(f"Error parsing arguments: {e}") |
| 1263 | return {} |
| 1264 | |
| 1265 | def _extract_result_value(self, result: Any) -> Any: |
| 1266 | """Extract the actual value from MCP response structures. |
no outgoing calls