An agent receives JSON from a customs tariff tool. Occasionally fields are missing or units are wrong, which previously caused incorrect duty calculations. What should you implement before the agent commits downstream actions?
Select an answer to reveal the explanation.
Short Explanation
Tool output is untrusted data until proven otherwise. You should validate it against an explicit schema and business quality checks, then reject or remediate bad results before duty calculations run. Blind trust, guessing numbers, or skipping validation for demos all invite wrong financial outcomes.
Full Explanation
Implementing tool result validation and quality checks is a core tool-ecosystem skill. Validate tool results against an explicit schema and business quality checks, including required fields, unit ranges, and checksum or consistency rules, then reject or remediate before downstream tools run.
Trusting all tool JSON implicitly ignores real-world partial failures and upstream bugs. Converting tool JSON to free text and letting the model guess missing numbers introduces hallucination into numeric pipelines. Disabling schema validation to improve perceived latency in demos trades correctness for demo optics.
Combine JSON Schema or Pydantic-style validation with domain rules, such as weight greater than zero, ISO currency codes, and duty rate bounds.
Exam tip: Validate tool results the same way you validate user input, especially before money or compliance actions.