Agent Tool Design Best Practices Flashcards

(20 cards)

1
Q

Why is tool design important for AI agents?

A

Because the AI must understand what each tool does and how to use it correctly; vague tools cause mistakes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the ideal style of tools for beginners?

A

Specific, narrowly focused tools that prevent the AI from making invalid choices.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why are generic tools harder for agents to use?

A

They give the AI too much freedom and require the model to infer directory paths, file types, and intentions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Example of a generic tool to avoid:

A

read_file(file_path) — too unconstrained.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Example of a well-designed specific tool:

A

read_python_file(file_name) — limited to a folder and file type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a major trade-off when designing tools?

A

Specific tools reduce errors but limit reusability; generic tools increase flexibility but increase mistakes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why is JSON Schema used for tool definitions?

A

It provides precise structure, lists valid parameters, and helps the LLM format tool calls correctly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does JSON Schema help prevent?

A

Missing arguments, wrong types, or ambiguous instructions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What role does naming play in tool design?

A

Clear, descriptive names help the model understand what the tool does without guessing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Example of a bad tool name:

A

proc_handler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Example of a better tool name:

A

process_file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why is error handling inside tools important?

A

Good error messages help the AI self-correct and choose the right next action.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What should error messages include?

A

Both the error AND guidance on what the agent should try next.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Example of improved error message:

A

“File not found. Try calling list_python_files first.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why give instructions inside error messages (instead of in agent rules)?

A

Because instructions are delivered “just in time,” lowering cognitive load and improving accuracy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a major risk if tool descriptions are vague?

A

The AI might misuse tools, invent missing information, or call tools incorrectly.

17
Q

What is the rule for writing tool descriptions?

A

Be explicit about purpose, constraints, and allowed parameters.

18
Q

Example of strong tool design pattern:

A

list_python_files(), read_python_file(file_name), write_documentation(file_name, content)

19
Q

What type of tool schema should be avoided?

A

Tools that allow arbitrary file paths or uncontrolled access.

20
Q

What does good tool design achieve?

A

Safe, predictable, and reliable agent behavior.