Jaydon Kua
← writing

build note

How I built a tool-calling loop from scratch

2026-07-21agentsfrom-scratch

Placeholder post. Frontmatter above drives the card on /writingtitle, date, summary, tags.

Structure that works

Open with the problem, not the tech. Show the wrong version first, then the fix. End with what you'd do differently.

def loop(prompt, tools):
    while True:
        step = llm(prompt)
        if step.done:
            return step.answer
        prompt += observe(tools[step.tool](step.args))

Add a new post: drop another .md file in src/content/posts/.