AI / Claude Models Basics Interview Questions
What is tool use (function calling) in Claude and which models support it?
Tool use (also called function calling) allows Claude to request the execution of external functions and incorporate their results into its responses. You define a set of tools with names, descriptions, and input schemas; Claude decides when to call them and how to structure the arguments.
# Defining a tool for Claude to use
response = client.messages.create(
model="claude-opus-4-8",
max_tokens=1024,
tools=[
{
"name": "get_weather",
"description": "Get current weather for a city",
"input_schema": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"},
"unit": {"type": "string", "enum": ["celsius","fahrenheit"]}
},
"required": ["city"]
}
}
],
messages=[{"role": "user", "content": "What's the weather in London?"}]
)
# Claude responds with a tool_use block specifying the function and args
# You execute the function and return results in a tool_result blockAll current Claude models support tool use. Key capabilities include:
- Parallel tool use — Claude can call multiple tools simultaneously in one turn
- Multi-step tool use — Claude reasons across multiple tool call/result cycles
- Computer use — special tools (bash, text editor, computer) for Claude to interact with systems
- Fine-grained tool streaming — GA on Sonnet 4.6 and later (no beta header needed)
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
