MCPcopy
hub / github.com/CopilotKit/CopilotKit / ensureObjectArgs

Function ensureObjectArgs

packages/core/src/core/run-handler.ts:1061–1071  ·  view source on GitHub ↗
(
  parsed: unknown,
  toolName: string,
)

Source from the content-addressed store, hash-verified

1059 * @internal Exported for testing only.
1060 */
1061export function ensureObjectArgs(
1062 parsed: unknown,
1063 toolName: string,
1064): Record<string, unknown> {
1065 if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
1066 return parsed as Record<string, unknown>;
1067 }
1068 throw new Error(
1069 `Tool arguments for ${toolName} parsed to non-object (${typeof parsed})`,
1070 );
1071}
1072
1073/**
1074 * Parses raw tool call arguments into a validated object.

Callers 2

parseToolArgumentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…