Your operations agent integrates with three different shipment-tracking MCP servers (one per carrier). Each returns dates in a different format: one uses Unix timestamps (1714003200), one uses ISO 8601 ("2025-04-25T00:00:00Z"), and one uses U.S. short format ("4/25/2025").
The agent gets confused — sometimes treating timestamps as serial numbers, sometimes mis-parsing dates, sometimes silently producing wrong delivery estimates.
What's the cleanest fix?
Why did you pick that answer? Two or three sentences. The act of articulating it is what builds the judgment — not the click that follows.
PostToolUse hooks intercept tool results before the model processes them, which makes them the right layer for data normalization. Format heterogeneity from different MCP servers is exactly the kind of cross-cutting concern that shouldn't live in the agent's reasoning — every prompt token spent figuring out which date format applies is a token not spent on the customer's actual problem. Normalize at the boundary; let the agent see one consistent shape.
Asking the model to parse three different date formats by reading its prompt is fragile (one new format breaks it) and burns tokens on every call. Date parsing is deterministic; treat it deterministically.
Dropping two carriers because their data is awkward to consume is a business decision in disguise — and a bad one. The information is available; it just needs to be normalized before it reaches the model.
Running every date through a separate parse_date tool call adds latency, cost, and a new failure mode — and the agent has to remember to do it every time. A PostToolUse hook does this automatically and invisibly.