Does max_content_tokens also limit binary PDF fetches?

The Citead team, updated

In short. max_content_tokens limits fetched text, while Anthropic documents PDF fetches as base64 binary content outside that text limit.

Definition: max_content_tokens is the Anthropic web fetch setting that limits text content placed in Claude's context. Anthropic documents PDF fetches as base64-encoded binary content, and places that content outside the documented text limit.

Key facts

  • Anthropic's web fetch tool documentation says that max_content_tokens limits content included in context and truncates fetched content above the limit.
  • The same documentation says the limit applies to text content, while binary content such as PDFs is outside that scope.
  • A fetched PDF is returned as base64 data with the media type application/pdf, then processed like a directly attached PDF document.
  • Anthropic's tool reference lists four web fetch types: web_fetch_20260318, web_fetch_20260309, web_fetch_20260209, and web_fetch_20250910.
  • The limit is approximate, so the actual input token count can vary by a small amount.

What does max_content_tokens limit?

The setting controls how much fetched text enters the context. When the fetched text exceeds the configured value, the web fetch tool truncates it. Anthropic describes this as a way to control token use for large documents. The documented limit is approximate, so an application should treat the value as a target rather than an exact count of input tokens.

The tool definition shows the setting alongside the web fetch type:

{
  "type": "web_fetch_20250910",
  "name": "web_fetch",
  "max_content_tokens": 100000
}

The example value is an optional maximum content length in tokens from Anthropic's configuration example. It is a request setting, separate from max_tokens, which appears in the surrounding Messages API examples as the response limit.

How are PDF fetches represented?

Anthropic's web fetch flow says that the API retrieves the full text content for a specified URL. For a PDF, the result instead uses a document source with type set to base64 and media_type set to application/pdf. The documentation says the API processes that result like a directly attached PDF document.

That representation is why the answer to the question is no for the documented binary PDF payload. max_content_tokens is described as a text-content limit. The fetched PDF's binary data is returned through the PDF document path, and the page does not describe token truncation for that binary field.

Which web fetch versions support the setting?

Anthropic's tool reference classifies web fetch as a server tool and lists the four dated types above. It explains that a new dated tool version can change behavior, schema, or model support, while older versions remain available for existing integrations. The reference specifically associates web_fetch_20260209 with dynamic content filtering, web_fetch_20260309 with cache bypass, and web_fetch_20260318 with response-inclusion control.

Dynamic filtering is relevant when a page or PDF is large but only part of it is needed. Anthropic says it can filter content before it reaches the context window, and identifies filtering relevant information from PDFs as a use case. This feature starts with web_fetch_20260209 or a later version and runs through the code execution tool, which the API enables automatically for the request.

FAQ

If a PDF is large, will max_content_tokens truncate it?

Anthropic documents truncation for fetched text. Its PDF example uses base64 binary data, and the web fetch page does not document a PDF-specific truncation rule for that binary content.

Does the setting give an exact input token count?

No. Anthropic says the max_content_tokens limit is approximate and that the actual number of input tokens can vary by a small amount.

How can a request reduce the content taken from a large PDF?

Use a web fetch type with dynamic filtering, starting with web_fetch_20260209. Anthropic documents filtering relevant information from PDFs before it reaches the context window.

Sources

  1. Anthropic, "Web fetch tool", undated
  2. Anthropic, "Tool reference", undated

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark