Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

2.2.3. Agent Tools: Function, Code Interpreter, File Search, Connected

💡 First Principle: Tools fall into two families — you provide the logic (function/OpenAPI tools that call your code or APIs) or Foundry provides the logic (hosted tools like code interpreter, file search, web/Bing search). Matching the requirement to the right family is the recurring tool question.

The major tool types: Function tools map your own Python/C# functions to model-callable interfaces via JSON schema — use these for business actions (look up a ticket, place an order). Code Interpreter is a hosted, sandboxed Python environment for data analysis, math, and chart generation — the agent writes and runs code iteratively, isolated per session, with its own cost beyond tokens. File Search grounds the agent on uploaded files via a vector store. Connected/OpenAPI tools call external REST services by their OpenAPI spec. Web/Bing grounding brings in current public information.

ToolLogic provided byUse whenNote
Function toolYou (your code)Business actions, your APIsModel emits call; you execute
Code InterpreterFoundry (sandbox)Data analysis, math, charts🧪 Extra cost; per-session sandbox
File SearchFoundry (vector store)Ground on uploaded docsBacked by embeddings
Connected / OpenAPIExternal serviceCall a documented REST APIDriven by OpenAPI spec
Web / Bing groundingFoundryNeed current public infoPublic web data

⚠️ Exam Trap: Don't reach for Code Interpreter to "call our internal API" — that's a function or connected tool. Code Interpreter runs its own sandboxed Python for analysis; it isn't a gateway to your systems. Likewise, file search grounds on documents but can't take actions.

Reflection Question: An agent must compute statistics on an uploaded CSV and create a record in your CRM. Which tool handles each task, and why can't one tool do both?

Alvin Varughese
Written byAlvin Varughese
Founder18 professional certifications