Lesson 304 of 1596
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.
Creators · Agentic AI · ~30 min read
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
8 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
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.
Creators · 11 min
Personal Study Agent
Build an AI study agent that tracks what you've learned, plans your week, and adapts when you fall behind. Beyond chatbot prompting, into actual agentic study.
Creators · 11 min
Building Your First Agentic Workflow
Move past chatbots and build a workflow where AI takes multi-step actions on your behalf. Here's the safe-by-default beginner pattern.
