Function: validateToolUseResultPairing()
function validateToolUseResultPairing(messages): ToolPairingValidation;
Defined in: messages/index.ts:120
Validate that tool_result blocks have matching tool_use blocks. This prevents API errors like “Tool result block missing corresponding tool_use block”
Parameters
| Parameter | Type | Description |
|---|---|---|
messages | Message[] | Array of messages to validate |
Returns
Validation result with details about any mismatches