๐ Step 9: AI/LLM#256 / 291
Tool Use
Tool Use / Function Calling
๐One-line summary
An LLM selecting and invoking pre-declared functions to act on the world.
๐กEasy explanation
The AI picking from a list of pre-declared functions and saying "call this one with these arguments." Lets it actually act on real systems.
โจExample
// Model picks a function
tool_use:
name: "get_weather"
input: { city: "Seoul" }
โ Result: 21ยฐC, clear
โกVibe coding prompt examples
>_
Build an LLM tool-use example with two tools: weather lookup and calendar add. Include JSON Schema and handler code.
>_
Write an error-handling pattern that prompts the model to retry politely when it called a tool with bad arguments.
>_
Too many tools confuse the model. Group the tool list by intent and dynamically expose only what's needed.
Try these prompts in your AI coding assistant!