MCPcopy Index your code
hub / github.com/callstack/agent-device / parseCommandRpcParams

Function parseCommandRpcParams

src/daemon/server/http-server.ts:391–399  ·  view source on GitHub ↗
(params: Record<string, unknown>)

Source from the content-addressed store, hash-verified

389// Validate the command params at the boundary so malformed client input is rejected as
390// INVALID_ARGS (-> JSON-RPC -32602 / HTTP 400) instead of leaking as an internal 500.
391function parseCommandRpcParams(params: Record<string, unknown>): CommandRpcParams {
392 try {
393 return commandRpcParamsSchema.parse(params);
394 } catch (error) {
395 const detail =
396 error instanceof Error ? cleanSchemaParseMessage(error.message) : 'invalid command params';
397 throw new AppError('INVALID_ARGS', `Invalid params: ${detail}`);
398 }
399}
400
401function methodToDaemonRequest(
402 method: string,

Callers 1

methodToDaemonRequestFunction · 0.85

Calls 2

cleanSchemaParseMessageFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected