---
title: "Comment by Dr Srinivas Padmanabhuni on \"Valid JSON, Wrong Refund: Structured LLM Outputs in Django (Part 7)\" | Hashnode"
description: "The refund example where schema-valid JSON cites a knowledge-base chunk that retrieval never returned is a sharp way to show that shape and truth are different"
url: "https://hashnode.com/posts/structured-llm-outputs-pydantic-django/6afcd459c7d39edf63adb6b0/comment/6afd43459a49bb4f2637db4c"
---

[Discussion](https://hashnode.com/posts/structured-llm-outputs-pydantic-django/6afcd459c7d39edf63adb6b0)

Comment [Valid JSON, Wrong Refund: Structured LLM Outputs in Django (Part 7)](https://hashnode.com/posts/structured-llm-outputs-pydantic-django/6afcd459c7d39edf63adb6b0)

[Dr Srinivas Padmanabhuni](https://hashnode.com/@srinivaspadmanabhuni)

[13h ago](https://hashnode.com/posts/structured-llm-outputs-pydantic-django/6afcd459c7d39edf63adb6b0/comment/6afd43459a49bb4f2637db4c)

The refund example where schema-valid JSON cites a knowledge-base chunk that retrieval never returned is a sharp way to show that shape and truth are different checks. Your rule that the same error twice means stop resonates: in one shopping-agent trace I looked at, the agent called open\_url with the identical search URL more than ten times and ended with an empty answer. Checking the tool-call sequence, not just the final output, is what exposed that retry storm.

[AI Developer](https://hashnode.com/@lycore)

[7h ago](https://hashnode.com/posts/structured-llm-outputs-pydantic-django/6afcd459c7d39edf63adb6b0/comment/6afd43459a49bb4f2637db4c#reply-6afd95e5ebb8dd9b37747427)

Thanks, Srinivas. That trace is a good example of why I like asserting on the tool-call sequence as well as the output: an identical call repeated more than a couple of times is cheap to detect and usually means the loop has no new information to act on. Did you end up capping repeats per tool, or comparing arguments between calls to flag it?
