Justy: Cody, this tool-calling thing matters because people keep trusting agents with boring real work, then the agent clicks the wrong button. Cody: Yeah, and the weird part is the model may understand the request just fine. The failure is usually in the handoff, like wrong tool, malformed JSON, API error, then it confidently patches over the hole. Justy: Right. Cody: That Machine Learning Mastery piece is basically saying, stop treating tools like magic appendages. Treat them like contracts between a fuzzy reasoner and deterministic code. Justy: Tiny life update, I made coffee too late last night and then blamed my calendar this morning. Bad inputs, bad outputs. Anyway, this is the unglamorous part teams discover after the demo works once. Justy: The user story is concrete. A support rep wants an agent to check an order, search a knowledge base, maybe draft a refund note. Wrong tool or customer_name instead of customer_id, and the user sees a slow, wrong helper. Justy: And adoption gets stuck right there. Nobody in ops cares that the model was impressive in a sandbox if the real workflow needs three manual checks afterward. Cody: The protocol is simple, but the boundary is the whole game. The app gives the model tools with names, descriptions, and schemas. The model answers directly or emits a structured payload with the tool name and arguments. Then the system validates it, runs the API or function, handles errors, and sends the result back. The model never executes the thing. Justy: I like the contract framing. Don’t call something just “Search the web.” Say it’s for current or time-sensitive information, and say when not to use it. That negative guidance feels very product-y to me. Cody: It is also very systems-y. If knowledge_base_search and web_search overlap, the model invents a boundary unless the descriptions make one. Enums beat open strings, and output shapes matter because the model needs to know what empty or partial results mean. Cody: The part people under-budget is maintenance. Tool definitions drift, teams add nearly duplicate tools, and suddenly the agent is choosing from fifty tiny doors with similar labels. Justy: That catalog-size section felt painfully real. Five clear tools is a product. Fifty tools is a junk drawer with latency. The article suggests dynamic tool loading, or at least consistent prefixes by domain. Billing dot something, docs dot something, calendar dot something. Naming saves money. Cody: The error handling guidance is the bit I’d underline. Empty arrays are bad signals. A typed error like rate_limited with retry_after gives the model and orchestration layer something to work with. Transient stuff should get retries and backoff before the model sees it. Persistent failures need circuit breakers, and the model should be told the tool is unavailable. Justy: That is where trust gets built, I think. A user can handle, “I checked the order system, but shipping status is unavailable.” Not a polished answer that hides the missing piece. Cody: Parallel calls are similar. Sequential is safer, but if two tools don’t depend on each other, waiting is just latency. The catch is infrastructure. Parallel calls hit rate limits, connection pools, and auth tokens at the same time, so a notebook win can fall over under load. Justy: And if the results conflict, there needs to be a rule. Surface the conflict, or pick a priority source. Don’t let the model do emotional arbitration between two APIs. Justy: Security was the grown-up section. Read-only tools are safer, write actions need tighter permissioning, and irreversible stuff should probably pause for human approval. That doesn’t make the agent less advanced. It makes the workflow less terrifying. Cody: And prompt injection through tool outputs is still sneaky. If a retrieved document or API response contains instructions aimed at the agent, sanitize before that text re-enters the reasoning context. The article points to the OWASP Top 10 for LLM Applications as a preflight checklist. Justy: For Build Next, I’d keep it small. Make a weekend agent with three tools: local docs search, a fake order lookup, and a fake refund draft. Use Pydantic schemas, deliberately break arguments, and log every call. Cody: Yeah. I’d do Python with LangGraph or the OpenAI Agents SDK, plus pytest. Write tests for correct tool choice, first-attempt argument validity, and whether errors appear in the final answer. Justy: Could also read the Claude Cookbook tool-evaluation examples and Arize’s tool-calling eval piece, then make a tiny eval set of ugly cases. Duplicate tools, expired token, empty result, conflicting results. Solo-builder friendly, not a platform migration. Cody: That’s the move. Before adding more tools, trace what the small agent actually did: tool name, arguments, result, retry, final response. If the traces are messy with three tools, fifty tools will not make it wiser. Justy: Alright Cody, I’m filing this under boring plumbing that saves the demo. Coffee refill, then actual work.