Your AI database agent needs better errors than “tool failed”
Dev.to AI
•
Generative AI
“Tool failed” is not an error message. It is a debugging tax. When an AI agent queries a database through MCP, failures need to be structured enough for the agent to recover and specific enough for humans to audit. A database tool can fail because: user lacks tenant or role scope query exceeds row/time/cost budgets requested metric is not approved data source is stale or unavailable result was partially returned write requires approval before execution Those should not all collapse into the same generic error.