{"record":{"id":"7c3a2e8e1f421e9d","repo":"diegosouzapw/OmniRoute","slug":"invalid-kiro-tool-call-payload-missing-input","errorCode":null,"errorMessage":"Invalid Kiro tool_call payload: missing input","messagePattern":"Invalid Kiro tool_call payload: missing input","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"open-sse/executors/kiroToolCallValidation.ts","lineNumber":40,"sourceCode":"export function parseKiroToolInput(toolInput: unknown): unknown {\n  if (typeof toolInput !== \"string\") return toolInput;\n  try {\n    return JSON.parse(toolInput);\n  } catch (error) {\n    const message = error instanceof Error ? error.message : String(error);\n    throw new Error(`Invalid Kiro tool_call payload: input must be valid JSON (${message})`);\n  }\n}\n\nexport function validateKiroToolName(toolUse: JsonRecord): string {\n  const toolName = typeof toolUse.name === \"string\" ? toolUse.name.trim() : \"\";\n  if (!toolName) throw new Error(\"Invalid Kiro toolUseEvent: missing tool name\");\n  return toolName;\n}\n\nexport function validateKiroToolCallWrapperInput(toolInput: unknown): void {\n  if (toolInput === undefined) {\n    throw new Error(\"Invalid Kiro tool_call payload: missing input\");\n  }\n  const input = parseKiroToolInput(toolInput);\n  if (!input || typeof input !== \"object\" || Array.isArray(input)) {\n    throw new Error(\n      \"Invalid Kiro tool_call payload: input must be an object with name and arguments\"\n    );\n  }\n  const record = input as JsonRecord;\n  if (typeof record.name !== \"string\" || !record.name.trim()) {\n    throw new Error(\"Invalid Kiro tool_call payload: missing nested MCP tool name at input.name\");\n  }\n  if (!Object.prototype.hasOwnProperty.call(record, \"arguments\")) {\n    throw new Error(\n      \"Invalid Kiro tool_call payload: missing nested MCP tool arguments at input.arguments\"\n    );\n  }\n}\n","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/executors/kiroToolCallValidation.ts#L22-L58","documentation":"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.","triggerScenarios":"Thrown at open-sse/executors/kiroToolCallValidation.ts:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Discard the incomplete wrapper tool_call and continue the stream","Capture the raw event to check whether upstream now sends input under a different field"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}