Skip to main content
Glama

Scrape a page

scrape

Read one web page and hand it back as markdown, HTML, plain text, its links, a screenshot, a PDF, or the fields you ask for, read off the page by a model. engine: "auto" (the default) makes a plain HTTP request first and re-reads the page in a real Chromium when the body turns out to be a JavaScript shell, so you pay for a browser only when the page needed one. To send a search form or a JSON query, use method: "POST" with a body; to download a file exactly as the site sent it, ask for formats: ["raw"]. A link to a PDF or a Word file is read into text too, headings and paragraphs included. To click a cookie banner, type into a search box or run a script before the page is read, send browser.actions. Every request leaves through a residential proxy, or through your own with proxy: { pool: "custom", server }. The answer says which engine replied, where the page finally was and what it cost.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "scrape"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesThe page to read. An http(s) URL. Private and loopback hosts are refused.
bodyNoWhat a POST sends, at most 64 KB. Set its type in `headers`: `{"content-type": "application/json"}` for JSON, or `application/x-www-form-urlencoded` for a form. If the site redirects, a 301, 302 or 303 reads the next page with GET and without the body; a 307 or 308 sends it again only if the protocol, host and port stay the same, and otherwise stops and names the new address.
proxyNoWhere the request leaves from. Defaults to the managed residential pool.
retryNoHow many extra tries to give a page the site blocks, each from a different address. 0 (the default) takes the site's first no as the answer. A blocked page costs nothing, so a try that is blocked again is free, but it takes as long as the first one did, so the call can run that many times longer. Once your `browser.actions` steps click, type, press a key or run a script on a page, it is not tried again, so nothing is done twice. If one of your scripts ran in it, the block is charged.
engineNoHow to read it. "fetch" is a plain HTTP request; "browser" renders the page in a real Chromium; "auto" (the default) fetches first and escalates to the browser when the body turns out to be a JavaScript shell, billing whichever engine answered. A POST and "raw" always use "fetch", so leave it out for them.
expectNoWhat the page should answer with. Set `"json"` when you are reading an API: anything else that comes back (a maintenance notice, a "checking your browser" page, a login form) is then not your answer. It costs nothing, and we try again from another address instead of handing you a page you cannot parse. Without it, whatever the page returns is your answer.
maxAgeNoThe oldest copy of the page you accept, in milliseconds, up to 3600000 (one hour). If we still hold a copy of the same URL that your account read within that time, from the same country and with the same engine, you get it back for 0 credits and the answer says `cached: true`. If not, we read the page now and keep a copy for up to an hour, unless the page still needs JavaScript (`metadata.needsJs`). We may drop a copy sooner, to make room or on a deploy, and a batch keeps its own copies, apart from single calls. `0` always reads the page now, and keeps the copy for the calls after it. `extract` is still charged, because the model reads the copy again. Leave `maxAge` out to read the page fresh every time. A POST, or a call with `headers`, your own proxy, `browser` options, a screenshot, a PDF, `raw` or `escalate: false`, is always read fresh.
methodNoThe HTTP method. "POST" sends `body` to the URL, for a search form or a JSON query. It is sent once: never retried and never sent again another way, because sending it twice could repeat what it did.GET
browserNoHow to render it. Only the browser engine reads these. With `auto` they apply if the page turns out to need one, except `actions`, which always use the browser.
extractNoWhat to pull out of the page, for the "extract" format. A model reads the page and fills in the shape you asked for. Give it a JSON Schema, a sentence, or both. It reads what the page says; it does not do arithmetic over it, so ask for the numbers and add them up in your own code.
formatsNoWhat to hand back. "screenshot" and "pdf" come back as base64 and need the browser engine; asking for both costs no more than one. "extract" is the page read into fields by a model, and needs an `extract` block saying which ones. A link to a PDF or a Word (.docx) file is read into text, so the text formats work on it too. We read files up to 25 MB, and from a PDF the first 200 pages and the first 5 million characters. Reading a file costs what the engine costs: 1 credit with fetch, 5 with the browser. A Word file that holds more than 32 MB once unzipped answers FILE_TOO_LARGE, and a file link that answers a short web page instead of the file answers UPSTREAM_BLOCKED, both at no charge. A dead link is the exception: its 404 or 410 page is the site's answer, and comes back with that status at the fetch price. "raw" is the file exactly as the site sent it, as base64 with its content type: a PDF report, an image, a spreadsheet. It uses the fetch engine and holds up to 5 MB; a larger file answers FILE_TOO_LARGE at no charge, never cut short.
headersNoExtra request headers to send to the page, such as an authorization token, a cookie or a custom user agent. The connection's own headers cannot be set.
escalateNoWhether to try again a different way when the first attempt is blocked. On by default. `false` stops after one try. The site's refusal is your answer, and it costs nothing, unless your own `browser.actions` script ran in the page first. It is how you bound a call: with `auto`, trying again is what charges the browser price instead of the fetch one. A POST is sent once, so it is off for a POST.
timeoutMsNoHow long to give the page before giving up, in milliseconds. A page that never arrives costs nothing, unless your own `browser.actions` script ran in the page first.
excludeTagsNoCSS selectors for the parts of the page to leave out of `markdown`, `text` and `extract`, such as `[".comments", "#newsletter"]`. Up to 20 selectors, 256 characters each.
includeTagsNoCSS selectors for the parts of the page to keep, such as `["h1", ".price"]`. `markdown`, `text` and `extract` then hold only what they match, in page order, and `onlyMainContent` no longer applies. Hidden parts are never kept. Up to 20 selectors, 256 characters each.
onlyMainContentNoRead only the page's main content into `markdown`, `text` and `extract`: the article or the product, without the menus, ads and related links around it. On by default. Set `false` for the whole page. When the main content is under 50 words, you get the whole page instead. `html` and `links` always hold the whole page.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, it discloses fetch-first Chromium escalation and its billing consequence, residential or custom proxy egress, pre-read browser interactions, PDF/Word handling, and response metadata about the engine, final location, and cost. These details expose important execution, network, and pricing behavior without contradicting the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core purpose is front-loaded, and each sentence addresses a distinct useful capability without promotional filler. Packing all of this into one dense paragraph with several long sentences makes it less scannable than a short structured presentation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex 17-parameter tool, the description and rich schema together cover normal invocation unusually well: outputs, engine selection, POST and download cases, document extraction, browser actions, proxying, and high-level response metadata. The schema carries the detailed limits and failure or billing rules, while the output-format enumeration and response-metadata summary partly offset the absence of an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description earns additional credit by synthesizing scattered fields into task-oriented invocation patterns such as POST plus `body`, `raw` for downloads, and `proxy: { pool: "custom", server }`, although most underlying constraints remain in the schema and advanced parameters such as caching and retries are not discussed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence gives a specific verb and resource—reading one web page—and enumerates the available outputs, including model-based field extraction. This establishes clear single-page scope, but the description does not explicitly distinguish the tool from any sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete option-selection guidance: `method: "POST"` with `body` for forms or JSON queries, `formats: ["raw"]` for exact downloads, and `browser.actions` for interaction before reading. However, it provides no explicit when-not-to-use guidance or routing to alternative tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources