tool_summarize_page
Extract headings and key sections from web pages to provide structured overviews for developers, enabling quick content analysis without browser switching.
Instructions
Get a quick overview of a page.
Extracts headings and key sections.
Args: url: URL to summarize.
Returns: Page summary with sections.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
Implementation Reference
- src/devlens/tools/research.py:114-140 (handler)Implementation of the `summarize_page` function which fetches and formats a page summary.
async def summarize_page(url: str) -> str: """Get a structural summary of a page. Args: url: URL to summarize. Returns: Page summary with sections. """ summary = await _scraper.summarize(url) lines = [ f"# Summary: {summary.title}\n", f"> Source: {url}\n", "## Key Sections\n", ] if not summary.sections: lines.append("*No sections found*") else: for section in summary.sections: if section.summary: lines.append(f"- **{section.heading}**: {section.summary}") else: lines.append(f"- **{section.heading}**") return "\n".join(lines) - src/devlens/server.py:99-111 (registration)Registration of `tool_summarize_page` as an MCP tool, calling `summarize_page` from `devlens.tools.research`.
@mcp.tool() async def tool_summarize_page(url: str) -> str: """Get a quick overview of a page. Extracts headings and key sections. Args: url: URL to summarize. Returns: Page summary with sections. """ return await summarize_page(url)