( rawArgs: unknown, toolName: string, )
| 1083 | * @internal Exported for testing only. |
| 1084 | */ |
| 1085 | export function parseToolArguments( |
| 1086 | rawArgs: unknown, |
| 1087 | toolName: string, |
| 1088 | ): Record<string, unknown> { |
| 1089 | if (rawArgs === "" || rawArgs === null || rawArgs === undefined) { |
| 1090 | logger.debug( |
| 1091 | `[parseToolArguments] Tool "${toolName}" received empty/null/undefined arguments — defaulting to {}`, |
| 1092 | ); |
| 1093 | return {}; |
| 1094 | } |
| 1095 | const parsed = typeof rawArgs === "string" ? JSON.parse(rawArgs) : rawArgs; |
| 1096 | return ensureObjectArgs(parsed, toolName); |
| 1097 | } |
no test coverage detected
searching dependent graphs…