$ lexprog.com

// notes from an old coder -- php, databases, and the occasional rant

[December 01, 2026] AI

Prefer Tools Over Asking the Model to Browse Memory

Do not paste a 50-page runbook into the prompt 'just in case'. Expose lookup_runbook(topic) and let the agent pull one page.

────────────────────────────────────────────────────────

Prefer Tools Over Asking the Model to Browse Memory

Tip: If it is an API, expose it as a tool

Do not paste a 50-page runbook into the prompt 'just in case'. Expose lookup_runbook(topic) and let the agent pull one page.

tools = [lookup_runbook, list_incidents, page_oncall]

Gotcha: Giant system prompts rot

A 20k-token system prompt will contain stale on-call names. Tools stay fresh because they hit the live store.

system = open("entire_wiki.md").read()

Source: https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview

────────────────────────────────────────────────────────
<-- back to posts