LLM Tool Calling Integration Guide: Built-in vs. Standalone Tools

    This guide explains how to choose between built-in and standalone tool calling for LLM applications. It covers the shift of tool execution from the client to the server, the structural constraint that prevents mixing built-in and custom tools in one request, the two-stage retrieval pattern for agent scenarios, and the signed-field mechanism for preserving context across multi-turn conversations. It also provides a pre-integration checklist and a three-question decision framework to help teams control token budgets, reduce duplicate billing, and build observable tool-calling pipelines.

    1. The Real Problem Is the Entry Point, Not the Capability List

    When a cloud provider exposes search, web page reading, file parsing, OCR, and speech-to-text as a set of APIs, most teams start by scanning the capability table item by item. Then they hit a more practical question: with so many endpoints, which one should be integrated first.

    The cost of choosing the wrong entry point is not abstract. In the lighter case, the context gets stuffed with large amounts of irrelevant page content, the model’s attention is diluted, and answer quality drops. In the heavier case, the same file is repeatedly uploaded and parsed within a single session, producing duplicate billing and duplicate latency. So before integration, the real question is not whether a capability exists, but whether that capability runs on the server side or the client side.

    2. The Real Change: Tool Execution Moves from Client to Server

    The traditional approach is the classic function calling pattern: the model emits a structured call request, the business server executes the search, fetch, and parse steps, and the full returned text is appended back into the message list. This pipeline carries two hidden costs—execution consumes your own compute and adds operational complexity, and the full returned text consumes context tokens.

    The new generation of built-in tools moves the entire execution stage to the server side. The caller only declares which tool types to enable in the request; retrieval, link opening, and content extraction all happen on the server, and only the processed result is returned into the context. An analogy: previously you sent a courier out to pick up the item and haul it back to your warehouse; now the warehouse ships and shelves the item directly, and you only pick it off the shelf.

    An illustrative request structure (showing the shape only, not any specific API):

    1. {
    2. "messages": [{"role": "user", "content": "What industry news is worth following today"}],
    3. "tools": [{"type": "builtin_web_search"}],
    4. "stream": false
    5. }

    The typical scenario is a regular chat client that wants answers to include up-to-date information. The integration cost drops from “building your own crawling and cleaning service” to “adding one more declaration field,” with no need to maintain crawlers, deduplication, content extraction, or anti-scraping countermeasures.

    3. The Structural Constraint to Remember: Built-in and Custom Tools Cannot Be Mixed

    According to the official documentation, within the same request, built-in tools and caller-defined custom tools cannot be active at the same time. This is not a matter of capability strength but a limitation of the request structure: built-in tools execute inside the server, while custom tools must execute back on the client, and the two cannot coexist within a single round trip.

    This constraint is the root cause of many projects integrating the wrong entry point. The test is simple:

    • If the entire conversation only needs “the model to fetch information from external sources on its own,” use built-in tools;
    • If the request also needs to call your own functions (look up an order, check inventory, query an internal knowledge base), the built-in path is immediately unavailable, and you must use the standalone endpoint and orchestrate it yourself.

    4. Agent Scenarios Should Use the Standalone Endpoint and Control the Token Budget

    An agent with private knowledge base retrieval should bypass built-in tools and wrap retrieval and reading as two ordinary tools for the model to schedule. The most worthwhile design to borrow here is two-stage content fetching:

    1. The retrieval endpoint returns only titles, summaries, and relevance scores (summary only, no full text);
    2. The model judges which results are truly relevant based on the summaries, then issues a read request for the selected links to retrieve structured content (such as Markdown).

    An illustrative request:

    1. {"query": "latest release notes for a given framework", "count": 5, "need_content": false}

    The benefit is direct: the full text of irrelevant pages never enters the context, and tokens are spent only on the material finally adopted. In retrieval scenarios that routinely return ten results, this “summary first, full text later” two-stage approach can compress context usage by an order of magnitude while reducing the chance of the model being distracted by noise.

    5. Context Preservation in Multi-Turn Conversations

    Multi-turn scenarios have an easily overlooked detail. Following the approach in the official examples, after the built-in link reading capability fetches a page, the server encrypts the content and writes it into a signed field. On the next request, you can drop the previous turn’s reasoning process and the plaintext retrieval results, and send back only the read record along with the signature; the server decrypts it to restore the context.

    The equivalent effect is that page content is preserved across turns within the session but does not repeatedly take up space in the plaintext messages of every turn. For long-session products, this both controls the token growth curve and reduces the retention of sensitive content on the client side.

    6. Pre-Integration Checklist

    Whichever path you take, the following preprocessing steps should be in place before integration:

    • Query rewriting: normalize colloquial questions into retrieval-friendly expressions, adding tokenization and synonym expansion when necessary;
    • Result trimming: set caps on summary length, number of results, and content length to avoid single-turn context bloat;
    • Deduplication and ranking: rerank by source credibility and relevance, and remove duplicate content from the same source;
    • Traceable citations: retain source identifiers so answers can cite sources and support later audits;
    • Failure fallback: empty retrieval, read timeouts, and parse failures all need clear fallback messaging and retry strategies;
    • Cost control: apply idempotency control to per-call billed capabilities such as file parsing, OCR, and speech-to-text, using content fingerprints to avoid duplicate uploads;
    • Observability: build logs and monitoring alerts for tool call counts, context length, and per-turn latency so you can quickly determine whether an issue is a wrong entry point or missing preprocessing.

    7. Selection Decisions and Implementation Advice

    Three questions complete the decision: does this turn need to call your own functions? Do you need to preserve external content across turns? Is the context budget tight?

    If you need your own functions, choose the standalone endpoint and orchestrate it yourself. If you only want “fresher answers,” built-in tools are the least effort. For long sessions with a tight budget, prioritize the server-side signed preservation mechanism rather than repeatedly stuffing full text into the message list.

    From an engineering standpoint, abstract the tool layer into a unified adapter that hides the differences between the built-in and standalone forms, making it easy to switch by scenario later. If you need to carry parsing artifacts, session archives, or call logs, you can pair it with general cloud capabilities such as object storage, message queues, logging services, and monitoring alerts to make the tool-calling pipeline observable, replayable, and auditable.