Skip to main content
Glama

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
NameRequiredDescriptionDefault
urlYes

Implementation Reference

  • 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)
  • 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)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Y4NN777/devlens-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server