Skip to main content
Glama
KSroido

kagi-session2api-mcp

by KSroido

kagi_summarizer

Summarize content from a URL, including web pages, videos, and audio. Choose between paragraph prose or bulleted key points.

Instructions

Summarize content from a URL using the Kagi Summarizer.

The Summarizer can summarize any document type (text webpage, video, audio, etc.)

Note: This tool uses Kagi's internal summarizer endpoint accessed via session token. This is experimental and may break if Kagi changes their internal API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesA URL to a document to summarize.
summary_typeNoType of summary to produce. Options are 'summary' for paragraph prose and 'takeaway' for a bulleted list of key points.summary
target_languageNoDesired output language using language codes (e.g., 'EN' for English). If not specified, the document's original language influences the output.
engineNoSummarizer engine to use. 'cecil' is the default. Note: This is an experimental feature — the summarizer endpoint may change without notice.cecil

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the kagi_summarizer tool. Registered via @mcp.tool() decorator. Accepts url, summary_type, target_language, and engine parameters. Validates inputs using helper functions, calls client.summarize(), and formats the result.
    @mcp.tool()
    async def kagi_summarizer(
        url: str = Field(description="A URL to a document to summarize."),
        summary_type: Literal["summary", "takeaway"] = Field(
            default="summary",
            description=(
                "Type of summary to produce. Options are 'summary' for "
                "paragraph prose and 'takeaway' for a bulleted list of key points."
            ),
        ),
        target_language: str | None = Field(
            default=None,
            description=(
                "Desired output language using language codes "
                "(e.g., 'EN' for English). If not specified, the document's "
                "original language influences the output."
            ),
        ),
        engine: Literal["cecil", "agnes", "daphne", "muriel"] = Field(
            default="cecil",
            description=(
                "Summarizer engine to use. 'cecil' is the default. "
                "Note: This is an experimental feature — the summarizer "
                "endpoint may change without notice."
            ),
        ),
    ) -> str:
        """Summarize content from a URL using the Kagi Summarizer.
    
        The Summarizer can summarize any document type (text webpage, video,
        audio, etc.)
    
        Note: This tool uses Kagi's internal summarizer endpoint accessed via
        session token. This is experimental and may break if Kagi changes
        their internal API.
        """
        if not url:
            raise ValueError("Summarizer called with no URL.")
    
        if client is None:
            raise RuntimeError("Server not initialized. Session client is missing.")
    
        # Validate parameters
        engine = validate_engine(engine)
        summary_type = validate_summary_type(summary_type)
    
        result = await client.summarize(
            url=url,
            engine=engine,
            summary_type=summary_type,
            target_language=target_language,
        )
    
        return format_summarizer_result(result)
  • Registration of kagi_summarizer as an MCP tool using the @mcp.tool() decorator on the async function definition at line 120.
    @mcp.tool()
    async def kagi_summarizer(
  • Schema/type definitions for the kagi_summarizer tool parameters: url (str), summary_type (Literal['summary','takeaway']), target_language (str|None), engine (Literal['cecil','agnes','daphne','muriel']) defined via Pydantic Field descriptors.
    async def kagi_summarizer(
        url: str = Field(description="A URL to a document to summarize."),
        summary_type: Literal["summary", "takeaway"] = Field(
            default="summary",
            description=(
                "Type of summary to produce. Options are 'summary' for "
                "paragraph prose and 'takeaway' for a bulleted list of key points."
            ),
        ),
        target_language: str | None = Field(
            default=None,
            description=(
                "Desired output language using language codes "
                "(e.g., 'EN' for English). If not specified, the document's "
                "original language influences the output."
            ),
        ),
        engine: Literal["cecil", "agnes", "daphne", "muriel"] = Field(
            default="cecil",
            description=(
                "Summarizer engine to use. 'cecil' is the default. "
                "Note: This is an experimental feature — the summarizer "
                "endpoint may change without notice."
            ),
        ),
  • Validation helper functions used by kagi_summarizer: validate_engine() and validate_summary_type() that check engine/summary_type against allowed values.
    def validate_engine(engine: str) -> str:
        """Validate and return the summarizer engine name.
    
        Args:
            engine: Engine name to validate
    
        Returns:
            Validated engine name
    
        Raises:
            ValueError: If engine is not valid
        """
        if engine not in VALID_ENGINES:
            raise ValueError(
                f"Invalid summarizer engine: '{engine}'. "
                f"Valid engines: {', '.join(sorted(VALID_ENGINES))}"
            )
        return engine
  • The client.summarize() method called by the kagi_summarizer handler. Makes the actual HTTP request to Kagi's internal /mother/summary_labs endpoint with session token authentication.
    async def summarize(
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full responsibility for behavioral disclosure. It clearly states the experimental nature, potential breakage, and support for various content types. It does not detail error handling or rate limits, but the explicit warning about instability adds significant transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and structured: a clear purpose statement, a brief capability note, and a critical caution. Each sentence serves a purpose, though the capability note could be integrated into the first sentence.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's 4 parameters and existing output schema (not shown), the description provides enough context to understand the tool's function and risks. However, it lacks guidance on error handling, prerequisites (e.g., need for a valid session token), and typical usage scenarios, which would enhance completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so the baseline is 3. The description adds limited value, only restating the summary_type and engine options in a mildly explanatory way. It does not introduce new meaning beyond the schema's own descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool summarizes content from a URL using Kagi Summarizer, including support for various document types. It distinguishes from the sibling tool (kagi_search_fetch) by focusing on summarization rather than search, though no explicit comparison is made.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description warns that the tool is experimental and may break due to internal API changes, which provides important context. However, it does not specify when to use this tool over alternatives or when not to use it, leaving the agent to infer from the sibling tool's purpose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/KSroido/Kagi-Session2API-MCP'

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