Stop Making Agents Do Complex Logic: Keep It in Code

sapnesh · reddit · 2026-08-06

A developer points out that many AI agent tools are just 1:1 API wrappers, causing models to take the blame for poor tool design.

The author argues that providing granular endpoints like search, create, and update forces the agent to handle branching logic, pushing deterministic if/else decisions into the least deterministic part of the system. A single upsert tool is far more reliable.

Recommended best practices for production agents:

For customer-facing agents taking real actions, developers should prefer fewer, task-specific tools over broad, provider-shaped endpoints.

Original post →

More from coding & agent

coding & agent channel →