diegosouzapw/OmniRoute · error · Error

Invalid Kiro tool_call payload: missing input

Error message

Invalid Kiro tool_call payload: missing input

What it means

Validation in validateKiroToolCallWrapperInput: the nested tool_call wrapper event has no input field at all (undefined). The Kiro wrapper protocol requires an input payload carrying the nested MCP tool name and arguments, so its absence makes the wrapper untranslatable.

Solutions

  1. Discard the incomplete wrapper tool_call and continue the stream
  2. Capture the raw event to check whether upstream now sends input under a different field
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at open-sse/executors/kiroToolCallValidation.ts:40 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/7c3a2e8e1f421e9d. Report an issue: GitHub.

Appendix: source

Thrown at open-sse/executors/kiroToolCallValidation.ts:40

export function parseKiroToolInput(toolInput: unknown): unknown {
  if (typeof toolInput !== "string") return toolInput;
  try {
    return JSON.parse(toolInput);
  } catch (error) {
    const message = error instanceof Error ? error.message : String(error);
    throw new Error(`Invalid Kiro tool_call payload: input must be valid JSON (${message})`);
  }
}

export function validateKiroToolName(toolUse: JsonRecord): string {
  const toolName = typeof toolUse.name === "string" ? toolUse.name.trim() : "";
  if (!toolName) throw new Error("Invalid Kiro toolUseEvent: missing tool name");
  return toolName;
}

export function validateKiroToolCallWrapperInput(toolInput: unknown): void {
  if (toolInput === undefined) {
    throw new Error("Invalid Kiro tool_call payload: missing input");
  }
  const input = parseKiroToolInput(toolInput);
  if (!input || typeof input !== "object" || Array.isArray(input)) {
    throw new Error(
      "Invalid Kiro tool_call payload: input must be an object with name and arguments"
    );
  }
  const record = input as JsonRecord;
  if (typeof record.name !== "string" || !record.name.trim()) {
    throw new Error("Invalid Kiro tool_call payload: missing nested MCP tool name at input.name");
  }
  if (!Object.prototype.hasOwnProperty.call(record, "arguments")) {
    throw new Error(
      "Invalid Kiro tool_call payload: missing nested MCP tool arguments at input.arguments"
    );
  }
}

View on GitHub (pinned to a179ffed5b)