Daily Vibe Challenge

Challenge #002 ·

Tool-Using Research Desk Agent

Intermediate2–3 hoursAI agents / tool use

Description

A minimal CLI agent that answers questions by deciding which of three local tools to call (calculator, file search, a notes store), looping until it has an answer. The point is a clean, inspectable agent loop you fully understand.

Starter Prompt

Build a small command-line AI agent in Python (or TypeScript if you prefer) called "desk-agent".

Requirements:
- Use any chat LLM API with tool/function calling (read the API key from an env var; make the provider swappable behind one function).
- Implement exactly three tools with JSON schemas:
  1. calculator(expression: str) — safely evaluates arithmetic (no eval of arbitrary code).
  2. search_files(query: str) — case-insensitive search across .md/.txt files in ./docs, returning file names and matching lines (max 10).
  3. notes(action: "add"|"list", text?: str) — persists notes to notes.json.
- Agent loop: send the user message plus tool schemas, execute any tool calls, feed results back, repeat until the model returns a final answer or 6 steps pass.
- Print each step clearly: "→ tool: name(args)" and "← result (truncated to 200 chars)".
- Include a ./docs folder with 3 short sample files so it works out of the box.
- Add a --dry-run flag that shows which tool would be called without executing it.

Write a README with setup, an example session, and how to add a new tool. Keep it under ~250 lines of code total.

Success Criteria

Optional Extensions

Built it? Share your build and get featured in the showcase & weekly roundup: Submit your build →

Plain markdown: 002-agent-research-desk.md

⚡ Get tomorrow's challenge before everyone else

One fresh challenge + copy-paste starter prompt in your inbox every morning, plus a weekly roundup of the best community builds. Free, no spam, unsubscribe in one click.

Or follow on Bluesky · RSS/Atom · Newsletter archive