Skip to main content
Glama

Convert Page to Markdown

page_to_markdown
Read-only

Converts web pages or supplied HTML into clean Markdown for LLM context, preserving headings, code blocks, links, and tables while removing navigation, headers, and footers.

Instructions

Fetch a web page URL and convert it to clean Markdown optimized for LLM context. Preserves headings, code blocks (with language hints), links, and tables; keeps the main content and drops navigation, headers, footers, and sidebars. It fetches without cookies and runs no page scripts, so a page behind a sign-in or one rendered only by JavaScript comes back as its login page or with no content. For those, pass the page HTML you already have from a browser tool as html (with its url, relative links resolve and nothing is fetched), or ask the user to turn on Agent Bridge in the Page2AI browser extension 1.6.0 or later (if its popup has no Agent Bridge switch, that install is an older store version and the extension must be updated first): while it is connected, url pages open in the user's own browser with its cookies and scripts, and a page the extension declines is fetched by the server, with a note saying why. It requests only the URL given, as a browser opens a page, so docs sites return the page itself, not a Markdown copy of it; a URL that names a Markdown or text file (a raw GitHub README.md, an llms.txt) comes back as written. A long page comes back in parts (max_length, start_index), the first part listing the page's sections, and a page the server cannot read comes back with the next step to take. Discovers tab groups statically and emits each panel as a ### Tab: {label} section instead of concatenating (prevents Python+TypeScript examples merging into one broken block). Zero external API calls: pages are parsed locally (linkedom) or in the user's browser.

Input Schema

NameRequiredDescriptionDefault
urlNoAbsolute HTTP or HTTPS URL of the web page to convert. Blocks private ranges, loopback, and cloud metadata endpoints. Given with `html`, it is not fetched: it names the page the HTML came from, and relative links resolve against it.
htmlNoRaw HTML of the page to convert instead of fetching it, e.g. from a browser tool. Pass the page's `url` with it so relative links resolve. Either `url` or `html` is required.
max_lengthNoReturn at most this many characters of the page's Markdown. A longer page comes back in parts: each part names the start_index of the next one, and the first part lists the page's sections with their start_index. Range: 100-1000000.
timeout_msNoAbort the fetch after N milliseconds. Range: 1000-60000.
start_indexNoCharacter offset to read from: the start_index a part named for the next one, or a section's from the list on the first part. Later parts come from the text the first part was cut from, kept for 10 minutes.
include_imagesNoInclude image references (![alt](src)) in the output. Applies on every path, including through Agent Bridge.
include_frontmatterNoPrepend a YAML frontmatter block with title, source URL, capture timestamp, language, description, and canonical URL. Applies on every path, including through Agent Bridge.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.8.0
    • addedInput schema / properties / max_length
      Added value: +{
      +  "default": 30000,
      +  "description": "Return at most this many characters of the page's Markdown. A longer page comes back in parts: each part names the start_index of the next one, and the first part lists the page's sections with their start_index. Range: 100-1000000.",
      +  "maximum": 1000000,
      +  "minimum": 100,
      +  "type": "integer"
      +}
    • addedInput schema / properties / start_index
      Added value: +{
      +  "default": 0,
      +  "description": "Character offset to read from: the start_index a part named for the next one, or a section's from the list on the first part. Later parts come from the text the first part was cut from, kept for 10 minutes.",
      +  "minimum": 0,
      +  "type": "integer"
      +}
  2. Changed2 schema fields changedv0.6.3
    • changedInput schema / properties / include_frontmatter / description
      Previous value: -"Prepend a YAML frontmatter block with title, source URL, capture timestamp, language, description, and canonical URL. Through Agent Bridge the extension's own output settings apply instead."New value: +"Prepend a YAML frontmatter block with title, source URL, capture timestamp, language, description, and canonical URL. Applies on every path, including through Agent Bridge."
    • changedInput schema / properties / include_images / description
      Previous value: -"Include image references (![alt](src)) in the output. Through Agent Bridge the extension's own output settings apply instead."New value: +"Include image references (![alt](src)) in the output. Applies on every path, including through Agent Bridge."
  3. Changed5 schema fields changedv0.5.3
    • addedInput schema / properties / html
      Added value: +{
      +  "description": "Raw HTML of the page to convert instead of fetching it, e.g. from a browser tool. Pass the page's `url` with it so relative links resolve. Either `url` or `html` is required.",
      +  "maxLength": 10000000,
      +  "type": "string"
      +}
    • changedInput schema / properties / include_frontmatter / description
      Previous value: -"Prepend a YAML frontmatter block with title, source URL, capture timestamp, language, description, and canonical URL."New value: +"Prepend a YAML frontmatter block with title, source URL, capture timestamp, language, description, and canonical URL. Through Agent Bridge the extension's own output settings apply instead."
    • changedInput schema / properties / include_images / description
      Previous value: -"Include image references (![alt](src)) in the output."New value: +"Include image references (![alt](src)) in the output. Through Agent Bridge the extension's own output settings apply instead."
    • changedInput schema / properties / url / description
      Previous value: -"Absolute HTTP or HTTPS URL of the web page to convert. Blocks private ranges, loopback, and cloud metadata endpoints."New value: +"Absolute HTTP or HTTPS URL of the web page to convert. Blocks private ranges, loopback, and cloud metadata endpoints. Given with `html`, it is not fetched: it names the page the HTML came from, and relative links resolve against it."
    • removedInput schema / required
      Removed value: -[
      -  "url"
      -]
  4. First observedv0.1.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnly, destructive=false, openWorld), and the description goes well beyond them: no cookies, no script execution, no external API calls, local linkedom parsing, SSRF blocking of private ranges (in schema), 10-minute retention of the paginated source text, and the exact failure modes for auth-gated and JS-only pages. That is exactly the behavioral context the annotations can't convey.

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?

Purpose is front-loaded and every paragraph is load-bearing, but the middle section is an extremely dense run-on covering Agent Bridge version detection and the tab-group rendering rationale. Some of that (older store version, example-block merging) could be trimmed or moved to a note without losing decision-relevant information.

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 7-parameter tool with no output schema and open-world network access, the description covers the fetch modes, fallback chain, pagination protocol, and error recovery paths. An agent has everything needed to choose the right input path and interpret a partial or failed result.

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 coverage is 100%, so baseline is 3, but the description adds real meaning: `url` + `html` together means nothing is fetched and relative links resolve against `url`, and `max_length`/`start_index` are described as a linked pagination contract rather than independent knobs. It stops short of explaining `timeout_ms` and `include_images`/`include_frontmatter` interactions, which the schema covers anyway.

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

Purpose5/5

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

The first sentence names a specific verb and resource ("Fetch a web page URL and convert it to clean Markdown") and adds a scope qualifier ("optimized for LLM context"). It then enumerates what is preserved and what is dropped, so the agent knows exactly what output shape to expect without opening the schema.

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

Usage Guidelines5/5

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

Explicit routing logic is given for the hard cases: sign-in or JS-rendered pages should use the `html` parameter with `url`, or the Agent Bridge path; `max_length`/`start_index` handle long pages. It even states the fallback order (extension-first, then server fetch with a note explaining why) and what to do when the server cannot read a page.

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

Deploy Server

Other Tools