```yaml
product: AlterLab
title: "Tool Use — Web Scraping Glossary | AlterLab"
comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data."
source_url: https://alterlab.io/glossary/tool-use
```

ai-agent

# Tool Use

Tool use is the ability of an AI model to call external functions or APIs during generation, enabling it to retrieve live data, execute code, and interact with the world.

Large language models are text-in, text-out systems. Tool use (also called function calling) extends this by allowing the model to emit a structured call to a predefined function — a web search, a database query, a calculation, or an API request — and then incorporate the result into its response. The model decides when to call a tool based on the user's query and the tool descriptions it has been given.

Tool use transforms an LLM from a static knowledge store into an active agent. A model equipped with a web scraping tool can fetch the current price of a product rather than guessing from training data. A model with a code execution tool can run calculations rather than approximating them in text. Chaining multiple tool calls allows complex multi-step reasoning.

AI platforms expose tool use through API schemas (OpenAI's `tools` parameter, Anthropic's `tools` block) or via protocols like MCP. Each tool is described by a name, description, and JSON Schema for its parameters. The model's output may include a `tool_use` block; the calling application executes the tool and passes results back in the next turn.

### What is Tool Use?

Tool use is the ability of an AI model to call external functions or APIs during generation, enabling it to retrieve live data, execute code, and interact with the world.

### How does AlterLab handle Tool Use?

AI platforms expose tool use through API schemas (OpenAI's `tools` parameter, Anthropic's `tools` block) or via protocols like MCP. Each tool is described by a name, description, and JSON Schema for its parameters. The model's output may include a `tool_use` block; the calling application executes the tool and passes results back in the next turn.

## Examples

```
# Anthropic tool use: scrape a URL during generation
import anthropic

client = anthropic.Anthropic()
response = client.messages.create(
    model="claude-opus-4-5",
    tools=[{"name": "scrape", "description": "Fetch a URL", "input_schema": {
        "type": "object", "properties": {"url": {"type": "string"}}, "required": ["url"]}}],
    messages=[{"role": "user", "content": "What is the price on example.com/product?"}]
)
```

## Related Terms

[MCP (Model Context Protocol)MCP is an open protocol by Anthropic that standardises how AI models connect to external tools, APIs, and data sources through a uniform server-client interface.](https://alterlab.io/glossary/mcp)[LLM (Large Language Model)A Large Language Model is a neural network trained on vast text corpora that can generate, summarise, translate, and reason over natural language at human level.](https://alterlab.io/glossary/llm)[Agent OrchestrationAgent orchestration coordinates multiple AI agents or tool calls in a structured workflow to complete complex, multi-step tasks that exceed a single LLM call.](https://alterlab.io/glossary/agent-orchestration)[RAG (Retrieval-Augmented Generation)RAG is an AI architecture that grounds LLM responses in retrieved documents, combining a vector search step with language model generation to reduce hallucinations.](https://alterlab.io/glossary/rag)[Scraping APIA managed web scraping service that abstracts proxy rotation, JavaScript rendering, and automatic website compatibility into a single HTTP endpoint.](https://alterlab.io/glossary/scraping-api)

## Extract Tool Use data from any website

AlterLab returns clean, structured data from any public URL — no scraper infrastructure needed. Start free, no credit card required.

[View API docs](https://alterlab.io/docs/api/rest)

[Back to Glossary](https://alterlab.io/glossary)