Should your AI agent write the IBAN validator itself, or call a versioned MCP tool instead?

sandeepK1125 · reddit · 2026-11-17

The Apyhub team (disclosure: their MCP server is the product in question) frames a real engineering dilemma: ask an agent to "validate these IBANs" or "check this VAT number" and it confidently improvises a small function each time — different implementations, inconsistent edge-case handling, zero testing.

Their answer: for tasks with one right answer (IBAN/VAT checks, sanctions screening, PDF conversion, invoice extraction), expose each as a versioned service behind MCP so the agent calls the same tested code every run, across models. The tradeoffs are an extra network call and dependency — and the harder problem of giving the model a good reason to pick the tool over its own code, since models are overconfident they can write a checksum function.

They open two questions for practitioners: which tasks you let agents code vs. force through tools, and how to stop the "just quickly write it" reflex when a tool exists.

Original post →

More from coding & agent

coding & agent channel →