LoopAI-103

Before you start

Short explainers for ideas this lesson builds on. Watch these first if they're new to you.

0 of 1 watched · about 2 min

Go deeper

Unlocks when you've watched the lesson.

0 of 1 watched · about 2 min
Read this lesson

How tools work

On its own, a language model can only write text. Tools change that: they're functions the agent can call to take actions, reach data, and work with other systems. Picture the agent as a detective, and the tools as the instruments and contacts on the desk. Here's the cycle, and it runs automatically. A user sends a message. The agent reads the request and decides which tools, if any, it needs. It calls those tools and passes in the details they need, called parameters. The tools do their work and hand back results. The agent weaves those results into a plain-language answer. And that answer goes back to the user. You don't write the code that coordinates any of this; the agent handles it. Foundry keeps its tools in a catalog with three groups. Configured: built-in tools, ready to use. Catalog: more tools you pull in from a registry, MCP servers among them. And Custom: your own tools, described with an OpenAPI specification or built yourself. You'll find the catalog under Build, then Tools, in the portal, or in the VS Code extension.

The main tools

Let's meet the tools you'll use most. Code Interpreter writes and runs Python in a secure sandbox, a sealed-off space where the code can't touch anything else. It handles maths, data analysis, charts, and file processing. Ask for the compound interest on ten thousand dollars at five percent a year for ten years, and it writes code to get the exact answer instead of guessing. File Search lets the agent draw on your own documents; this is retrieval-augmented generation, or RAG. You upload files, like PDF, Word, text, or Markdown, into a vector store: an index that files passages by meaning, so the agent finds the relevant ones even when the wording differs. Bing Web Search brings in live information from the internet, like current events, beyond what the model learned in training, and it adds citations so you can check the sources. Azure AI Search sounds a lot like File Search, so here's the difference. File Search searches the documents you hand the agent yourself; Azure AI Search plugs into the big search indexes your organization already runs, at enterprise scale. OpenAPI tools connect the agent to external web services. An OpenAPI specification is a standard description of an API: its operations, the inputs they need, and what they send back. You provide the spec, and Foundry maps the parameters and reads the responses for you. The catalog holds many more: browser automation for web pages and forms, computer use for desktop apps, image generation, SharePoint, Microsoft Fabric data agents, deep research, agent-to-agent delegation, and a customizable code interpreter. And it keeps growing, so check the portal for the latest.

Adding tools in VS Code

In VS Code, you can add tools in Agent Builder, or in the YAML file. In Agent Builder, open your agent and go to the Tools section. Select Add Tool, or the plus icon, browse the tool library, and pick a tool. Configure any settings it needs, then save. Some tools prompt you to set up related pieces: add File Search, and you create or choose a vector store for your documents. The YAML route suits you when you know exactly which tools you want, or you're applying a template. Here's a research assistant. Its instructions say when to use each tool: Code Interpreter for analysis, and Bing for current information. Under tools, each item in the list starts with a dash and a type. Code Interpreter needs nothing else. Bing grounding needs a connection ID, which points to the Bing resource it's allowed to use. And File Search needs a vector store ID, which tells it which set of indexed documents to search. So some tools stand alone, and others need a reference to the thing they connect to.

MCP and good habits

What if you need a tool that isn't built in? The Model Context Protocol, or MCP, is a standard way to plug custom tools into agents. Think of a standard socket: any tool built to the standard fits any agent that supports it. MCP servers, the programs that offer those tools, live in the Catalog section. They come in three kinds. Remote servers are hosted elsewhere and reached over the network; they're the usual choice in production. Local servers run on your own machine, which is handy for trying a tool in VS Code, but an agent running in Foundry can only reach a remote server. And custom servers are ones you build for your own needs. The benefits: a standard protocol makes behavior predictable, tools are built once and reused across agents and projects, the community shares ready-made tools in registries, and consistent interfaces mean less integration and maintenance work. In VS Code, you browse MCP servers in the tool registry, add one to your agent, configure its settings, test it in the playground, and then deploy. A few habits keep tools reliable. Start with built-in tools; they're tested and maintained. Match tools to real needs, because every tool adds latency, a little extra waiting time. Tell the agent when to use each tool, and when not to. Keep File Search documents up to date, since stale files lead to wrong answers. And test in the playground: send messages that should trigger each tool, check it's called correctly, and try error cases too. Put together, a research agent might search the web for fresh facts, analyse them with Code Interpreter, and check internal docs with File Search, all in one answer. That's how tools turn a chat window into real automation, and later modules go deeper on tools and MCP.

Facts from Microsoft's documentation: What is Microsoft Foundry Agent Service?; Use Code Interpreter with Microsoft Foundry agents; File search tool for Microsoft Foundry agents; Connect agents to MCP server endpoints (CC BY 4.0), rewritten in Loop's own words and examples. Narration, animation, and quiz by Loop. Microsoft, Azure, and Microsoft Foundry are trademarks of Microsoft. Loop is independent and not affiliated with or endorsed by Microsoft.