Skip to main content
Glama

get_summary

Extract concise summaries from Wikipedia articles to quickly understand key information without reading full pages. Provide the article title to receive a structured summary with title and content.

Instructions

Get a summary of a Wikipedia article.

Returns a dictionary with the title and summary string. On error, includes an error message instead of a summary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler and registration for 'get_summary'. Delegates to WikipediaClient.get_summary and formats response as dict with title and summary or error.
    @server.tool()
    def get_summary(title: str) -> Dict[str, Any]:
        """
        Get a summary of a Wikipedia article.
    
        Returns a dictionary with the title and summary string. On error,
        includes an error message instead of a summary.
        """
        logger.info(f"Tool: Getting summary for: {title}")
        summary = wikipedia_client.get_summary(title)
        if summary and not summary.startswith("Error"):
            return {"title": title, "summary": summary}
        else:
            return {"title": title, "summary": None, "error": summary}
  • Core implementation of get_summary using wikipediaapi.Wikipedia.page(title).summary, with error handling.
    def get_summary(self, title: str) -> str:
        """
        Get a summary of a Wikipedia article.
    
        Args:
            title: The title of the Wikipedia article.
    
        Returns:
            The article summary.
        """
        try:
            page = self.wiki.page(title)
    
            if not page.exists():
                return f"No Wikipedia article found for '{title}'."
    
            return page.summary
        except Exception as e:
            logger.error(f"Error getting Wikipedia summary: {e}")
            return f"Error retrieving summary for '{title}': {str(e)}"
  • Optional LRU caching applied to get_summary method when enable_cache=True.
    self.get_summary = functools.lru_cache(maxsize=128)(self.get_summary)
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the return format (dictionary with title and summary) and error handling (includes error message on error), which are valuable behavioral traits. However, it omits details like rate limits, authentication needs, or whether it's read-only/destructive, leaving gaps in behavioral context.

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

Conciseness5/5

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

The description is extremely concise and front-loaded, with two sentences that directly state the purpose and return behavior. Every sentence adds essential value without redundancy, making it efficiently structured and easy to parse.

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

Completeness4/5

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

Given the tool's low complexity (single parameter), no annotations, and the presence of an output schema (which handles return values), the description is reasonably complete. It covers the core purpose and error handling, though it could improve by adding parameter guidance or usage context relative to siblings.

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 0% description coverage, but the description adds no parameter-specific information beyond implying 'title' is required. It doesn't explain what the 'title' parameter represents (e.g., article title format) or provide examples, so it only marginally compensates for the schema's lack of documentation.

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

Purpose5/5

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

The description clearly states the specific action ('Get a summary') and resource ('a Wikipedia article'), distinguishing it from siblings like 'get_article' (full article) and 'summarize_article_for_query' (query-based summarization). It precisely defines what the tool does without being vague or tautological.

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 implies usage for obtaining article summaries, but provides no explicit guidance on when to use this tool versus alternatives like 'summarize_article_for_query' or 'get_article'. It lacks context about prerequisites, exclusions, or comparative use cases with sibling tools.

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/Rudra-ravi/wikipedia-mcp'

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