Skip to main content
Glama

Crawl a site into a dataset

writ_crawl_site
Destructive

Collects a website or section into a queryable, change-tracked dataset with one row per page, enabling content extraction, comparison, and monitoring across a site.

Instructions

COLLECTS a site or a section into a queryable, change-tracked dataset (one row per page). Scope: intent (a section, in plain words), rank_cap=N (the top N items of a listing), seed_urls (known pages), or the whole site capped by page_budget. Modes: markdown (default, no AI), extract_mode='schema' (uniform records), executor='ai' + extract_prompt (per-page understanding, 5x the page rate). A bounded crawl answers with its rows; an open one returns a crawl_id for writ_crawl_status wait=true. NOT FOR: reading a few pages now (writ_scrape). Every option: writ_help('writ_crawl_site').

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": "writ_crawl_site"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYes
nameNo
waitNoHold until done and return the rows (default true when bounded).
limitNo
speedNo
deviceNo
intentNoThe section wanted, in plain words; the server derives paths and depth.
outputNo
max_ageNo
save_asNo
delay_msNo
executorNoregular (default, no AI) | ai (5x the page rate).
ocr_modeNo
rank_capNoTop N items of a listing (one page per agent, in parallel).
max_depthNo
seed_urlsNoExact pages to collect (no discovery).
persona_idNo
shard_sizeNo
page_budgetNoCap on pages fetched.
render_modeNo
same_domainNo
content_specNo
extract_modeNomarkdown (default) | schema | html.
exclude_pathsNo
include_pathsNo
preview_charsNo
extract_promptNoWith executor=ai: what to extract from each page.
extract_schemaNoWith extract_mode=schema: CSS {row_selector, fields: [{name, selector, attr?}]}, not a JSON Schema.
respect_robotsNo
timeout_secondsNo
use_residentialNo
allow_subdomainsNo
relevance_thresholdNo
residential_countryNo
max_concurrent_shardsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed30 schema fields changedv1.2.1
    • removedInput schema / properties / content_spec / description
      Removed value: -"Which ELEMENTS of each page to keep: {preset: 'full'|'main', include_comments: bool, exclude_selectors: [css], include_selectors: [css], keep: {images: bool}}. 'main' = article body only; 'full' = the whole page INCLUDING comment and discussion threads — use 'full' with include_comments when the ask mentions comments, replies or discussion, or they will be stripped out."
    • removedInput schema / properties / delay_ms / description
      Removed value: -"Politeness delay between fetches per host (default 250)."
    • removedInput schema / properties / device / description
      Removed value: -"A linked Writ desktop's agent_id (writ_devices): act ON it. Omit to use the desktop this connection chose with writ_devices action='use' (if any)."
    • changedInput schema / properties / executor / description
      Previous value: -"regular (default) = deterministic crawl, no AI. ai = a fleet of AI agents reads every page against `extract_prompt` and returns structured records — for data with no clean CSS selector. Bills at 5x the page rate."New value: +"regular (default, no AI) | ai (5x the page rate)."
    • changedInput schema / properties / extract_mode / description
      Previous value: -"markdown (default) | schema (uniform records via extract_schema) | html (each page's RAW HTML, for selectors or embedded JSON)"New value: +"markdown (default) | schema | html."
    • changedInput schema / properties / extract_prompt / description
      Previous value: -"Required with executor=ai: what each agent should extract from each page, in plain language (e.g. 'the product name, price and SKU')."New value: +"With executor=ai: what to extract from each page."
    • addedInput schema / properties / extract_schema / description
      Added value: +"With extract_mode=schema: CSS {row_selector, fields: [{name, selector, attr?}]}, not a JSON Schema."
    • changedInput schema / properties / intent / description
      Previous value: -"Plain-English goal. The server derives include/exclude paths and a depth from it against a sample of the site's real URLs, and ranks the frontier by relevance — so on an unfamiliar site this beats guessing path regexes yourself."New value: +"The section wanted, in plain words; the server derives paths and depth."
    • removedInput schema / properties / limit / description
      Removed value: -"Rows of collected data to return when wait=true (default 50)."
    • removedInput schema / properties / max_age / description
      Removed value: -"Only meaningful with `save_as`: if that saved crawl already completed within this many seconds, return its collected data instead of crawling again. 0 always crawls."
    • removedInput schema / properties / max_concurrent_shards / description
      Removed value: -"Explicit parallel-shard cap; overrides the `speed` allocation."
    • removedInput schema / properties / ocr_mode / description
      Removed value: -"auto (default) | off | force"
    • removedInput schema / properties / output / description
      Removed value: -"RESPONSE SHAPE — set this whenever the answer is for a program or an API you are building, not for you to read. {shape: 'envelope' (default: Writ's full answer, projected) | 'table' ({columns, rows, total}) | 'records' (bare list of records) | 'record' (the newest record alone — one entity, a usage meter, a dashboard), fields: ['used', 'percent_used as pct', 'items.0.price as first_price'] (ordered pick, renames, dotted paths; missing → null so keys are stable), exclude: ['depth'], include_meta: false (page metadata content_kind/depth/thumbnails are STRIPPED unless true), key: 'usage' (wrap)}. On writ_crawl_site with save_as it is SAVED as the API's default shape."
    • removedInput schema / properties / output / properties
      Removed value: -{
      -  "exclude": {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  "fields": {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  "include_meta": {
      -    "type": "boolean"
      -  },
      -  "key": {
      -    "type": "string"
      -  },
      -  "shape": {
      -    "enum": [
      -      "envelope",
      -      "table",
      -      "records",
      -      "record"
      -    ],
      -    "type": "string"
      -  }
      -}
    • addedInput schema / properties / page_budget / description
      Added value: +"Cap on pages fetched."
    • removedInput schema / properties / persona_id / description
      Removed value: -"Saved identity to crawl AS (list them with writ_personas) — for pages behind a login. Every shard shares the persona's signed-in session and one sticky exit IP. 2FA is minted server-side. A desktop persona ('device:…') crawls on its own desktop, from that machine."
    • removedInput schema / properties / preview_chars / description
      Removed value: -"Cut each inline page's text cells to this many characters (default 12000; 0 = full pages). Cut rows list the fields under `_truncated`; fetch a full page with writ_workflow_data(workflow_id=<data_workflow_id>, refs=['<run_id>:<record_index>'])."
    • changedInput schema / properties / rank_cap / description
      Previous value: -"TOP-N ASK — set this whenever the user wants the top/first N items from a listing (a front page, search results, a category). The server reads the seed page's link order (which IS the ranking), seeds exactly those N item pages, and pins the crawl to them — one page per agent, in parallel. WITHOUT it the same request becomes a breadth crawl that mostly collects nav and pagination and does not answer the question. Pair with include_paths when you know the item-link shape."New value: +"Top N items of a listing (one page per agent, in parallel)."
    • removedInput schema / properties / relevance_threshold / description
      Removed value: -"0-1. Score every discovered page against `intent` and SKIP anything below the bar, so a broad crawl collects only what the goal needs (≈0.3 for 'the pricing and docs pages'). Leave unset for a whole-site sweep."
    • removedInput schema / properties / render_mode / description
      Removed value: -"How each page is FETCHED — independent of `executor`, which decides who READS it. auto (default) = plain HTTP first, warm browser only for JS-challenge or near-empty pages; http = never open a browser (fastest, static HTML); browser = warm-render every page (JS/SPA sites). executor=ai works on either lane."
    • removedInput schema / properties / residential_country / description
      Removed value: -"Two-letter ISO country the residential exit should be in (e.g. 'us', 'fr') — pins the exit pool's geo for every shard. Omit for an automatic exit. Ignored unless the session egresses residential."
    • removedInput schema / properties / respect_robots / description
      Removed value: -"Honor robots.txt (default true)."
    • removedInput schema / properties / save_as / description
      Removed value: -"ONLY when the user will want to re-run this crawl later (a recurring pull, an API they asked for): saves these settings as a named, callable crawl. A one-off question does NOT need one — saved crawls are listed to every future session as 'already collected', so a saved one-off misleads the next agent. Reusing the same name updates that saved crawl instead of creating a duplicate."
    • changedInput schema / properties / seed_urls / description
      Previous value: -"Exact pages to start from, when you already know them — the crawl collects these instead of discovering its own. Cheapest way to scrape a known set."New value: +"Exact pages to collect (no discovery)."
    • removedInput schema / properties / shard_size / description
      Removed value: -"URLs fetched per shard batch (default 20)."
    • removedInput schema / properties / speed / description
      Removed value: -"Throughput tier: slow | normal (default) | fast — how much of your parallel-agent allowance the crawl uses. slow ≈ ¼ at a discounted page rate, normal ≈ ½ at standard rate, fast = all of it at a premium."
    • removedInput schema / properties / timeout_seconds / description
      Removed value: -"Max seconds to hold when wait=true (≤75)."
    • removedInput schema / properties / url / description
      Removed value: -"Seed URL (required)."
    • removedInput schema / properties / use_residential / description
      Removed value: -"Route every shard through the platform residential network (premium). Turn on for sites that block datacenter IPs / show a bot wall — a persona crawl forces it on automatically. Costs residential bandwidth; default off."
    • changedInput schema / properties / wait / description
      Previous value: -"Block until the crawl converges and return the collected pages IN THIS CALL (`data.rows`). Default TRUE for a bounded crawl (rank_cap or seed_urls — a few pages, seconds) and false for an open site crawl (returns a crawl id to poll with writ_crawl_status). Past the 75s ceiling you get a 504 that still carries the crawl id."New value: +"Hold until done and return the rows (default true when bounded)."
  2. First observedv1.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Beyond the annotations it discloses cost (executor='ai' at 5x the page rate), the default no-AI path, the bounded-vs-open return contract (rows vs crawl_id) and the page_budget cap. It does not address the persistence/destructive side flagged by destructiveHint=true — e.g. whether a repeat crawl overwrites an existing dataset or what gets replaced — which is the one meaningful gap for a write-flagged tool.

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?

Front-loaded with purpose, then scope, then modes, then return contract, then exclusions — a logical order with no filler sentences. The capitalized keywords and label:value shorthand make it dense but scannable; it is near the upper limit of density for a single paragraph.

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

Completeness4/5

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

For a 35-param, open-world, non-idempotent crawl tool with no output schema, it covers the critical decisions: how scope is chosen, which mode costs more, and what comes back in each case. It is incomplete on the dataset destination/naming params and on the destructive semantics of repeat crawls, which is the remaining risk an agent faces before calling.

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

Parameters3/5

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

With 35 parameters and only 26% schema coverage, the description must carry the load; it adds real meaning for the scope-driving params (intent, rank_cap, seed_urls, page_budget) and the mode params (executor, extract_mode, extract_prompt). However, roughly two dozen options — render_mode, ocr_mode, speed, device, shard_size, same_domain, include/exclude_paths, save_as, name, timeout — are undocumented in both schema and description, deferred wholesale to writ_help.

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?

"COLLECTS a site or a section into a queryable, change-tracked dataset (one row per page)" gives a specific verb, resource, and output shape, plus it explicitly carves out the adjacent tool ("NOT FOR: reading a few pages now (writ_scrape)"). An agent can distinguish this from writ_scrape and writ_crawl_status without opening any 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?

It enumerates the four scope selection mechanisms (intent, rank_cap, seed_urls, whole site with page_budget) with the condition for each, names the mutually exclusive reading tool, and routes to writ_crawl_status for the async case. The alternatives and the when-not are both stated.

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