INNER CODE UNIT · Python

browser_read_text

feder-cr/Jobs_Applier_AI_Agent_AIHawk · src/aihawk/mcp/server.py:432

async def browser_read_text(selector: str = "body",
                            max_chars: int = actions.DEFAULT_MAX_CHARS,
                            browser: Browser = None) -> str:
    """The visible text of an element, with the markup gone.

    The cheapest way to read a page. Narrow the selector when you know where the
    answer is; use browser_read_html instead when the structure matters, or
    browser_snapshot when you need something to click.

    Long text is cut at max_chars (6000 by default) and the cut is marked in
    what comes back, so text that ends without that marker is the whole thing."""
    # ⛔ THE CAP WAS WRITTEN THREE TIMES: the constant in `actions.py`, this
    # signature, and the prose above. The signature was the copy worth removing
    # - nothing read it back, so it could drift from the constant in silence
    # and the tool would honour a number its own module did not declare.
    #
    # ⛔ THE PROSE COPY STAYS, AND A DRAFT THAT DELETED IT WAS WRONG. The
    # reasoning was that the schema already publishes `"default": 6000`, so the

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…