Skip to content
ML Academy

LLMs, GenAI, RAG, agents, evaluation · insight-0632

Prefer narrow, purpose-built tools over generic ones like raw SQL or HTTP

Evidence type
practitioner heuristic
Difficulty
medium
Roles
Applied AI, ML engineer
Industries
aviation, banking

Summary: situation, action, reason, boundary

  1. Situation

    A customer-service agent gets a run_sql tool or a generic http_request tool "so it can handle anything".

  2. Action

    Replace generic tools with narrow ones whose parameters encode business limits, for example issue_voucher(booking_id, reason_code) with the amount computed server-side from policy.

  3. Reason

    Narrow interfaces make mistakes harder to express. Anthropic's guidance recommends tool arguments that make errors difficult, and OWASP names excessive functionality as a root cause of excessive agency.

  4. Boundary

    Production agents acting on customer, financial or operational data.

Symptom or risk

The model can read or change any table or call any endpoint, so one bad generation becomes a data leak or an unauthorised change.

Exceptions

Analyst copilots on read-only replicas with row-level security, where flexibility is the product.

Trade-offs

More tools to build and document; group them by task to keep each request's tool list short.

Pitfalls

Passing amounts or permissions chosen by the model straight to the backend.

Lessons and concepts

Claims and their sources