{"record":{"id":"e321acd70ebd676b","repo":"diegosouzapw/OmniRoute","slug":"invalid-kiro-tool-call-payload-missing-nested-mcp-e321ac","errorCode":null,"errorMessage":"Invalid Kiro tool_call payload: missing nested MCP tool arguments at input.arguments","messagePattern":"Invalid Kiro tool_call payload: missing nested MCP tool arguments at input\\.arguments","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"open-sse/executors/kiroToolCallValidation.ts","lineNumber":53,"sourceCode":"  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\nexport function validateKiroToolUse(toolUse: JsonRecord): void {\n  const toolName = validateKiroToolName(toolUse);\n  if (toolName === KIRO_TOOL_CALL_WRAPPER) {\n    validateKiroToolCallWrapperInput(toolUse.input);\n  }\n}\n\nexport function appendBufferedKiroToolInput(\n  toolCall: PendingKiroWrapperToolCall,\n  toolInput: unknown\n): void {\n  if (toolInput === undefined) return;\n  if (typeof toolInput === \"string\") {","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/executors/kiroToolCallValidation.ts#L35-L71","documentation":"Validation guard inside validateKiroToolCallWrapperInput: a Kiro tool_call wrapped in the MCP wrapper tool arrived with input.arguments missing or not the expected nested object, so the inner tool's arguments cannot be decoded. It fires when the upstream Kiro stream emits a wrapper payload whose input object lacks a well-formed arguments field.","triggerScenarios":"Thrown at open-sse/executors/kiroToolCallValidation.ts:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the producer so wrapper tool_calls always embed input.arguments as an object containing name and arguments","Log the raw toolInput to identify the malformed upstream frame","Reject the frame early instead of propagating a half-parsed tool call downstream"],"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"}