← Table of Contents · Page 161 of 868

DESIGNING GOOD TOOLS

Part 8 of 10

PRACTICE LAB CONNECTION The Resume Review Agent's write_report tool is the star of this chapter. In Chapter 65, the write_report tool overwrites an existing report without asking, which is a planted weakness, and in Chapter 67 you add an approval step so that a repeated or mistaken call can no longer replace a report silently. Run the prompts below against that tool. ARTIFICIAL INTELLIGENCE ASSISTANT PROMPTS [START OF PROMPT] Critique this tool's design for clarity, composability, idempotency, and error-message quality: [PASTE TOOL NAME, DESCRIPTION, INPUT SCHEMA, AND HANDLER CODE, e.g. lab write_report tool]. Specifically test it against being called twice in a row with identical arguments and state whether the result changes undesirably. Output format: four labeled critique sections (Clarity, Composability, Idempotency, Error Messages), each ending in a concrete fix. [END OF PROMPT] [START OF PROMPT] Audit all tools in this registry for idempotency gaps , any action tool that would cause unintended duplicate effects if retried after a timeout: [PASTE LAB TOOL REGISTRY / HANDLERS HERE]. For each gap, propose the specific code-level fix (such as an idempotency key, a check-before-write, or converting an increment to a set operation). Output format: a table (Tool, Idempotency Gap, Fix). [END OF PROMPT]
Advertisement
Read Aloud:
0:00 / 0:00