Server-Side Tools vs. Client-Side Orchestration: Where Should Web Search and File Reading Live in LLM Applications?
When building LLM applications that need web search and URL reading, developers face a key architectural choice: orchestrate tool calls in the application layer, or rely on server-side tools provided by the model API. This article walks through both approaches, explains how to choose between them, and highlights two easily overlooked pitfalls—built-in tools cannot be force-invoked via tool_choice, and enabling a capability does not guarantee the model will actually use it.
1. Starting from a Typical Scenario
Suppose we want to build an assistant that helps readers interpret product update notes: a user sends a link to an official website and asks, “What problems does this update fix?” This example is only used to illustrate workflow design and does not represent any actual test results.
To answer this question, the system must accomplish at least three things: identify the link in the user’s message, fetch the web page and extract its main content, and hand the organized material to the model for reasoning and summarization. It sounds simple, but “who executes each of these three steps” directly determines the architectural complexity and maintainability of the application.
There are two common paths in the industry: one is for the application to orchestrate the tool-call chain itself; the other is to use tool capabilities provided on the model server side, letting the service handle execution and result injection. Let’s look at each.
2. Path One: Application-Side Orchestration, with the Model Only Making Judgments
In this mode, the application is the “driver” of the entire workflow, while the model is merely the “navigator.”
The typical flow looks like this:
- The application first identifies the link in the user’s input;
- The application sends an HTTP request to fetch the web page, handling exceptions such as download failures, timeouts, and anti-scraping measures, and performs content extraction and cleaning;
- The application passes the cleaned text to the model as context;
- If the model determines the information is insufficient and a supplementary query is needed, the application calls a search API again, receives the results, and continues to the next round of conversation.
The core characteristic of this architecture is: the model makes the judgments, and the application makes the tools actually run. What the model outputs is “intent”—for example, “I need to search for a certain keyword”—while the actual request dispatching, result parsing, and error retries are all handled by application code.
The advantage of this approach is control: the application can precisely control how query terms are constructed, how many results to keep, and how content is filtered, which makes auditing and caching easier. The cost is engineering effort—developers must shuttle data back and forth between the model and tools, handling the exception branches of every round.
3. Path Two: Server-Side Tools, Pushing Execution Down to the Service
A different approach: the client only declares the allowed capabilities in the request, and the server handles the actual tool execution, automatically injecting the retrieved material into the context so the model can continue reasoning.
One easily misunderstood point deserves emphasis: even with server-side tools, “model judgment” and “tool execution” are still two distinct stages. The model still decides when to trigger a search and when to read a link; it’s just that developers no longer need to manually shuttle results between the two—the loop logic is encapsulated on the server side.
The advantages are obvious: low integration cost, no need for developers to maintain crawling, parsing, and retry infrastructure, and better conversational context continuity since tool results directly participate in reasoning. However, for scenarios requiring fine-grained control over query behavior, it offers relatively weaker controllability.
4. How to Choose? The Dividing Line in Official Documentation
The common industry practice is to use “who controls the workflow” as the decision criterion:
- Let the model decide when to go online: use the server-side tools within the chat capability. The application only declares the capabilities, while the timing and manner of triggering are determined autonomously by the model. This suits general Q&A and document-assisted comprehension scenarios.
- The application controls query terms itself and directly obtains search or fetch results: use standalone search and fetch APIs. This suits scenarios where search results need to be displayed in your own UI, further processed, or incorporated into business approval workflows.
A simple decision principle: if the search results themselves are part of the business deliverable, choose the standalone APIs; if search is only meant to help the model generate more accurate answers, choose server-side tools.
5. An Easily Overlooked Detail: Declaring a Capability Does Not Mean It Will Be Invoked
Taking typical server-side web tools as an example, requests usually need to explicitly declare tools—for instance, a tool for web search and a tool for reading links in user messages. An application that only wants to read a specified link without performing generalized search can declare only the latter.
But there are two important constraints where many developers stumble:
First, these built-in tools cannot be force-invoked the way custom functions can. A common practice is to use the tool_choice parameter to force the model to call a specific custom function, but applying this approach to built-in web tools directly returns an error (such as a 400). Whether a search or link read is actually executed is ultimately up to the model’s own judgment.
Second, setting tool_choice to none also disables web capabilities. If you globally disable tool selection in order to constrain certain custom functions, the built-in search and link-reading capabilities will fail along with it.
This leads to a conclusion that matters greatly for product design: a UI showing “web access enabled” only means the capability is available—it does not prove that a particular answer actually queried external sources. Whether the model goes online depends on its judgment of the current question. If the business requires that “this answer must be based on real-time retrieval,” you cannot rely on the model’s autonomous judgment; instead, use the standalone search API to explicitly execute retrieval on the application side before feeding the results to the model.
6. Practical Recommendations for Architecture Selection
Combining the characteristics of both paths, here are several implementation recommendations:
- Capability declaration and actual invocation are two different things. Monitoring and statistics should distinguish between “number of times the capability was enabled” and “number of actual triggers” to avoid distorted product data.
- Controllability requirements determine the architecture. For scenarios with strict timeliness and accuracy demands (such as price comparison or public opinion monitoring), lean toward application-side orchestration; for general assistant products, server-side tools can significantly reduce maintenance costs.
- Design for degradation. Regardless of which path you take, web fetching can fail, so prepare fallback messaging or retry strategies in advance.
- Pay attention to interactions between parameters. Tool-related parameters (such as tool_choice) can have coupled effects, so run dedicated regression tests for web-enabled scenarios before launch.
Web search and file reading may look like small features that just require “flipping a switch,” but behind them lies an architectural decision about who owns execution. Think clearly about “judgment goes to the model—who does execution go to?” and your application can be both smart and controllable.
