← Lesson
Tool Docs in the Prompt
Joeven
Run
Reset
Python loads on first run
CATALOG = { "get_job": "get_job(job_id:int) read-only. Use for status. Not for refunds.", "finish": "finish(answer:str) when the goal is met.", "handoff": "handoff(reason:str) when you cannot act.", "shell": "shell(cmd:str) NEVER in billing agents.", } def docs_for(enabled): lines = [] for name in enabled: lines.append(CATALOG[name]) lines.append("Tools not listed do not exist.") return "\n".join(lines) billing = docs_for(["get_job", "finish", "handoff"]) print(billing) print("shell hidden", "shell" not in billing) print("enabled present", "get_job" in billing and "handoff" in billing) print("few-shot must not mention shell either")
Run to execute this in your browser. Nothing is sent to a server.