{"id":"html_pageworkers_preview","name":"HTML PageWorkers Preview","alias":"HtmlPageWorkersPreview","aliases":[],"description_short":"Preview PageWorkers.","description_long":"\n    Get the preview for PageWorkers descriptor for a selector or templates rendering.\n    ","description_tool_prompt":"\n    Get the preview for PageWorkers descriptor for a selector or templates rendering.\n    ","source":"SiteCrawler or Browser fetching","conversation_examples":[],"tags":["content"],"available_in_chat":true,"available_in_deepthink":false,"available_in_mcp":true,"mcp_audience":"all","config":{"type":"object","properties":{},"required":[]},"item":{"type":"object","properties":{"url":{"description":"The URL to be used","title":"Url","type":"string"},"options":{"$ref":"#/$defs/PreviewOptions","default":{"use_liquid_engine":false},"description":"Preview options"},"selectors":{"anyOf":[{"items":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"string"}]},"type":"array"},{"type":"null"}],"default":null,"description":"Optional list of extracts to preview. Each entry is an ExtractPreviewConfig object (kind: singleValue / multiValue / arrayOfObjects / jsonLd, with `type` for jsonLd) — the same shape as `extracts`. Config keys use snake_case (css_selector, container_selector, extract_type) and are converted to camelCase before hitting the JS engine. A bare string is also accepted as shorthand for a singleValue CSS selector (the legacy `list[str]` contract). Each entry returns the touched element descriptors plus the extracted value, serialized and truncated for display.","title":"Selectors"},"templates":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"description":"Optional list of PageWorkers templates to preview. Each entry should be a JSON stringified version of a template, with the `extract` and `context` fields.","title":"Templates"},"extracts":{"anyOf":[{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object"},{"type":"null"}],"default":null,"description":"Optional map of named extracts to resolve against the page. Each value follows the ExtractPreviewConfig shape (singleValue / multiValue / arrayOfObjects / jsonLd). Config keys use snake_case (css_selector, container_selector, extract_type) to match the rest of the API; they are converted to camelCase before being passed to the JS engine. Unlike templates, the raw extracted values are returned to the caller without template rendering or truncation.","title":"Extracts"},"detect_json_ld_types":{"default":false,"description":"If true, return the list of unique @type values found in the page's JSON-LD blocks. Useful to discover what structured data is available before requesting an `extracts` with kind: jsonLd.","title":"Detect Json Ld Types","type":"boolean"}},"required":["url"],"$defs":{"PreviewOptions":{"properties":{"use_liquid_engine":{"default":false,"description":"Whether or not to use liquid engine","title":"Use Liquid Engine","type":"boolean"}},"title":"PreviewOptions","type":"object"}}},"response":{"$defs":{"CssSelectorPreview":{"properties":{"descriptors":{"anyOf":[{"items":{"$ref":"#/$defs/PreviewDescriptor"},"type":"array"},{"type":"null"}],"default":null,"title":"Descriptors"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Error"}},"title":"CssSelectorPreview","type":"object"},"ExtractResult":{"properties":{"value":{"anyOf":[{},{"type":"null"}],"default":null,"title":"Value"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Error"}},"title":"ExtractResult","type":"object"},"PreviewAttribute":{"properties":{"key":{"title":"Key","type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"truncated":{"title":"Truncated","type":"boolean"}},"required":["key","value","truncated"],"title":"PreviewAttribute","type":"object"},"PreviewDescriptor":{"properties":{"tag":{"title":"Tag","type":"string"},"first_attributes":{"items":{"$ref":"#/$defs/PreviewAttribute"},"title":"First Attributes","type":"array"},"inner_html_excerpt":{"$ref":"#/$defs/PreviewExcerpt"},"inner_text_excerpt":{"$ref":"#/$defs/PreviewExcerpt"},"has_other_attributes":{"title":"Has Other Attributes","type":"boolean"}},"required":["tag","first_attributes","inner_html_excerpt","inner_text_excerpt","has_other_attributes"],"title":"PreviewDescriptor","type":"object"},"PreviewExcerpt":{"properties":{"value":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Value"},"truncated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Truncated"}},"title":"PreviewExcerpt","type":"object"},"TemplatePreview":{"properties":{"result":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Error"},"truncated":{"default":false,"title":"Truncated","type":"boolean"}},"title":"TemplatePreview","type":"object"}},"properties":{"crawl":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"","description":"If fetched from sitecrawler, the crawl where the URL was found","title":"Crawl"},"selectors_preview":{"anyOf":[{"items":{"$ref":"#/$defs/CssSelectorPreview"},"type":"array"},{"type":"null"}],"default":null,"description":"Preview of the elements matched by the CSS selectors","title":"Selectors Preview"},"templates_preview":{"anyOf":[{"items":{"$ref":"#/$defs/TemplatePreview"},"type":"array"},{"type":"null"}],"default":null,"description":"Preview of the rendered templates","title":"Templates Preview"},"extracts":{"anyOf":[{"additionalProperties":{"$ref":"#/$defs/ExtractResult"},"type":"object"},{"type":"null"}],"default":null,"description":"Resolved extracts for the requested keys. Each entry holds the native extracted value and a per-key error if extraction failed for that key on this page.","title":"Extracts"},"json_ld_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"description":"Unique JSON-LD @type values present on the page, when `detect_json_ld_types` was requested.","title":"Json Ld Types"}},"title":"HtmlPageWorkersPreviewProcessedItem","type":"object"},"has_canvas":false,"open_canvas_automatically":false}