Lesson 390 of 2116
OpenAI Tool Use: Functions, Web Search, Files, MCP, Shell, and Computer Use
Models get more useful when they can act through tools. Learn the difference between hosted tools, your own functions, and MCP-connected capabilities.
Lesson map
What this lesson covers
Learning path
The main moves in order
- 1Tools Turn Answers Into Workflows
- 2tool use
- 3function calling
- 4web search
Concept cluster
Terms to connect while reading
Section 1
Tools Turn Answers Into Workflows
A model without tools can only answer from context. A model with tools can search, retrieve files, call your code, inspect a browser, run a shell command in a harness, or ask an MCP server for domain-specific actions.
Compare the options
| Tool type | Use it for | Main design risk |
|---|---|---|
| Function calling | Your app's private data and actions | Bad schemas or unsafe side effects |
| Web search | Fresh public facts | Untrusted sources and citation quality |
| File search | Private document retrieval | Chunking and permission boundaries |
| Remote MCP | External systems exposed as tools | Approval and trust model |
| Shell or apply patch | Coding-agent workflows | Command safety and review |
| Computer use | UI automation | Slow brittle actions and account risk |
Hosted tools can be attached directly to a Responses request.
const response = await client.responses.create({
model: "gpt-5.5",
tools: [{ type: "web_search" }],
input: "Summarize today's product update and include source links.",
});The basic safety pattern
- 1Read-only tools can be automatic.
- 2Write tools need narrow schemas and logs.
- 3External actions need explicit user confirmation.
- 4Dangerous local tools need allowlists or sandboxes.
- 5Tool results should be treated as data, not instructions.
Key terms in this lesson
The big idea: tools make models useful because they connect language to systems. That is also why tools need boundaries.
End-of-lesson quiz
Check what stuck
15 questions · Score saves to your progress.
Tutor
Curious about “OpenAI Tool Use: Functions, Web Search, Files, MCP, Shell, and Computer Use”?
Ask anything about this lesson. I’ll answer using just what you’re reading — short, friendly, grounded.
Progress saved locally in this browser. Sign in to sync across devices.
Related lessons
Keep going
Builders · 40 min
What Tools Agents Can Use
Modern agents can use tools — like a browser, an email client, a calculator, a calendar.
Builders · 40 min
MCP — How Agents Connect to Tools
MCP (Model Context Protocol) is a standard way for agents to safely talk to tools.
Creators · 50 min
Tool Use at the API Level: The Primitive
Underneath every agent framework is the same primitive — the model returns a structured tool call, you execute it, you feed the result back. Master this loop and every framework looks familiar.
