assess

Assess a web resource and propose a traversal config for data extraction.

How to call

In supported clients the command syntax can vary. If the WDS MCP server is registered as wds, use:

Client Command
Visual Studio Code /mcp.wds.assess

Arguments

Name Type Required Default Description
url string No http://playground Start URL

Returned Prompt Text

The block below contains the complete prompt returned to the MCP client. Runtime placeholders map to arguments as follows:

ROLE:
Act as a web developer with experience in designing multi-page web resources, including paged data, templating, and expertise in pure CSS as well as in modern CSS frameworks: Bootstrap, Tailwind CSS, Foundation, Bulma, UIkit, Tachyons, Materialize, Metro, Spectre.css, Milligram, Pure.css, Skeleton, NES.css, W3.CSS, Picnic CSS, Basscss, Shoelace, etc.
Your experience includes working with web resources that have complex structures, such as those with paged data, hierarchical menus, and leaf pages with data accessible from various navigation elements. You are skilled in identifying and extracting data fields from web pages using CSS selectors and XPath expressions.

OBJECTIVE:
    Evaluate TARGET_URL with fetch-only inspection and propose a TraversalConfig for data extraction.

RESTRICTIONS:
    -   Only call WdsFetchChunked and WdsGetChunk.
    -   Call MCP tools with named arguments matching the tool parameter names.
    -   Use exact tool-returned values as inputs for later fetch steps. Do not rewrite or guess task IDs, URLs, or content spans.
    -   Do not create selectors, values, or traversal branches from unseen content. Fetch the relevant page or representative branch page first.
    -   Do not call job, traversal config, traversal run, or gathered-data tools from this prompt.
    -   On any MCP tool error, STOP WITH REASON and surface the error response.

GLOBAL CONSTANTS:
    TARGET_URL = '<url>'

    EXAMPLE_TRAVERSAL_CONFIG:
    Main page fields: Name and Price from #products rows.
    Same-template pagination: #paging a.
    Detail branch: product links from #products tr a, with Description and Category on the detail page.
    ```json
    {
  "name": "/",
  "crawlParams": [
    {
      "selector": "CSS: #paging a"
    }
  ],
  "scrapeParams": [
    {
      "name": "Name",
      "selector": "CSS: #products tr td a"
    },
    {
      "name": "Price",
      "selector": "CSS: #products tr td:nth-child(2)"
    }
  ],
  "branches": [
    {
      "entryRule": {
        "selector": "CSS: #products tr a"
      },
      "name": "product-details",
      "scrapeParams": [
        {
          "name": "Description",
          "selector": "CSS: #product-details .desc"
        },
        {
          "name": "Category",
          "selector": "CSS: #product-details .category"
        }
      ]
    }
  ]
}
    ```

SELECTOR HEURISTICS (use in this order)
	1.	Unique IDs (#main, #products, #product-details)
	2.	Stable data-* or semantic classes (.product, [itemprop=name])
	3.	Scoped structural selectors (#products tr td a)
	4.	nth-of-type / nth-child only as a last resort

DEFINITIONS
    PopulateTraversalConfig(jobName, url, currentCfg)
        OBJECTIVE: Inspect fetched HTML and build the TraversalConfig needed for data extraction.
        PROCEDURE:
            1.	Fetch the HTML:

            -   taskId = WdsFetchChunked(jobName=jobName, url=url)
            -   REPEAT:
                -   contentResult = WdsGetChunk(taskId=taskId, startIndex=0, length=1024)
                -   If contentResult is not null: BREAK
                -   Continue polling WdsGetChunk with the same arguments until contentResult is not null.
            -   pageHtml = contentResult.contentSpan if it is not null; otherwise ''
            -   contentLength = contentResult.contentLength if it is not null; otherwise length(pageHtml)
            -   If more unseen content is required for the current analysis:
                -   REPEAT:
                    -   startIndex = length(pageHtml)
                    -   If startIndex >= contentLength: BREAK
                    -   contentResult = WdsGetChunk(taskId=taskId, startIndex=startIndex, length=1024)
                    -   If contentResult is null: continue polling WdsGetChunk with the same arguments until contentResult is not null
                    -   Append contentResult.contentSpan to pageHtml
                -   UNTIL enough relevant content has been inspected or startIndex >= contentLength
            -   Analyze only the content present in pageHtml. If required evidence is in an unread span, read the next span before making conclusions.
            2.	Identify repeated record containers, individual data fields, same-template pagination links, and links to distinct detail templates.
            3.	Add field selectors to currentCfg.scrapeParams and same-template pagination selectors to currentCfg.crawlParams.
            4.	For each detail-template link selector:
                -   Prefer the shortest direct path to data pages over menu/category paths that reach the same data.
                -   Resolve one representative link against url, fetch it, create a subCfg with entryRule.selector set to the link selector, and populate subCfg from the fetched page.
                -   Append subCfg to currentCfg.branches unless a branch with the same entryRule.selector already exists.
                -   Decide same-level versus branch by page template and data role, not by URL string alone.
            5.	Return currentCfg.

PROCEDURE (EXECUTE IN EXACT ORDER)
    1.  Derive proposed job name
        -   Extract authority/host from TARGET_URL -> lowercase, normalized -> jobName
        -   Keep jobName short and meaningful because it will be passed to the scrape prompt after the job is configured.
    2.  Build Traversal configuration
        -   Create crawlCfg as a complete TraversalConfig with name = '/'
        -   crawlCfg = PopulateTraversalConfig(jobName, TARGET_URL, crawlCfg)
    3.  Provide assessment result
        -   Return the proposed jobName to pass to the scrape prompt after the job is configured as: Job name: <jobName>
        -   Return crawlCfg as JSON.
        -   Summarize the proposed root fields, pagination selectors, and branch selectors.

Please rotate your device to landscape mode

This documentation is specifically designed with a wider layout to provide a better reading experience for code examples, tables, and diagrams.
Rotating your device horizontally ensures you can see everything clearly without excessive scrolling or resizing.

Return to Web Data Source Home