LLM Web Access Explained: Who Performs Search and Web Page Reading
When building an LLM-powered assistant that reads web pages or searches for information, a key architectural decision is whether the application orchestrates tool calls itself or relies on server-side tools. This article compares both approaches, explains the limits of tool_choice parameters, clarifies why "capability enabled" does not mean "actually verified," and offers practical engineering recommendations for logging, source attribution, failure handling, and permission scoping.
1. Starting with a Research Task
Imagine building an assistant that helps readers compare product version updates. A user provides a link to an official release notes page and asks which issues the update resolves. The task looks simple, but it actually involves three actions: recognizing the link, fetching the page content, and generating an answer based on that content. Whenever any step requires external information, the model must rely on tools. So the first design question is: should web page reading and information retrieval be executed by the application, or delegated to the server side?
The following is a conceptual illustration of the flow, not actual test results.
2. Path One: Application-Orchestrated Tool Calls
In a self-orchestrated design, the application owns the full execution pipeline. A typical flow looks like this:
- The application parses the user message and identifies any links in it.
- The application issues network requests to fetch the pages, handling timeouts, redirects, download failures, and other errors.
- The application extracts the main content from each page, removing navigation bars, scripts, ads, and other irrelevant elements, and organizes it into structured material.
- The application passes the material to the model together with the question.
- If the model decides the information is insufficient, it returns a retrieval request. The application calls the search API, receives the results, and starts the next round of conversation.
In this mode, the model decides what information is needed, while the application makes every tool call actually happen. The advantage is strong control: query terms can be audited, timeout and retry policies can be customized, and whether data is desensitized is up to the application. The cost is engineering effort — every tool requires call logic, parsing, error handling, and loop control.
Illustrative code is shown below. All function and parameter names are placeholders, and concrete implementations are omitted:
def answer_with_self_orchestration(user_message, llm, search_tool, read_url_tool):links = extract_links(user_message)materials = []for url in links:try:html = read_url_tool(url, timeout=10)materials.append(extract_main_text(html))except Exception as e:materials.append(f"[Failed to read: {url}, reason: {e}]")messages = [{"role": "user", "content": build_prompt(user_message, materials)}]for _ in range(MAX_ROUNDS):reply = llm.chat(messages)if reply.tool_request is None:return reply.textresults = search_tool(reply.tool_request.query)messages.append({"role": "tool", "content": results})return "Maximum search rounds reached. Please narrow the scope of the question."
3. Path Two: Server-Side Tools
The alternative is for the client to simply declare which capabilities the model is allowed to use, and let the server execute the tools and feed the results back into the context. Developers no longer need to shuttle data back and forth between model decisions and tool execution. The model still decides whether to invoke a tool, and tool execution remains a separate step — only the loop is carried out on the server side.
Suitable scenarios include general-purpose Q&A assistants, prototypes that need to ship quickly, and applications that do not require fine-grained control over query terms. Unsuitable scenarios include those that require strict auditing of every external request, need to restrict accessible domains, or need to filter sensitive information before retrieval.
4. Two Entry Points: Who Controls the Flow
The core criterion when choosing a path is who owns control of the workflow.
- Let the model decide when to go online: use server-side tools in the conversation, where developers only need to declare capabilities.
- The application decides query terms itself, or directly obtains search results and web page content: use standalone search APIs and web scraping APIs, called and processed by the application.
The two can be combined. A system can enable server-side tools for general Q&A while having the application directly scrape specific business pages and pass the results to the model as context.
5. Capability Enabled Does Not Mean Verified This Time
After web tools are declared in a request, the model gains the ability to call external information — but this does not mean the current answer necessarily consulted external sources. Whether a tool is invoked depends on the question itself and the model’s judgment. When a user asks a common-knowledge question, the model may answer directly. If a user-provided link was never read, the answer should not contain phrases like “according to the page content.”
Tool choice parameters also come with constraints. Keep the following in mind during design:
- The tool choice parameter cannot force a specific server-side built-in tool; otherwise the request will be rejected by the server with a client error.
- Setting tool choice to off disables the related tools entirely, and the model can only answer based on the existing context.
- If a specific link must be read, the application should fetch the content first and place it into the context, rather than relying on the model to definitely call the reading tool.
6. Engineering Best Practices
- Log call information. Inspect the tool call records in responses and write them to logs, making it easier to troubleshoot issues where answers do not match their sources.
- Distinguish sources. Require the model to attribute content that cites external material, and preserve the original links.
- Design failure branches. When a page is inaccessible, content is empty, or the page requires login, the answer should clearly state the situation instead of guessing at the content.
- Limit input size. Web page content can be very long; it should be truncated or summarized on the application side to control context length and cost.
- Narrow permissions. Declare only the capabilities needed for the current scenario to reduce the risk of mistaken calls and data exposure.
7. Conclusion
The key to web access and file reading capabilities lies in who owns the workflow. Application-orchestrated execution offers the strongest control but requires shouldering full engineering complexity. Server-side tools significantly reduce integration cost, but execution details are determined by the server. Whichever path you choose, always separate “the capability is available” from “this answer was actually verified,” so that answer credibility is backed by evidence.
