Skip to main content
Glama

get_article

Retrieve complete Wikipedia article content by title to access detailed information for research or reference purposes.

Instructions

Get the full content of a Wikipedia article.

Returns a dictionary containing article details or an error message if retrieval fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for get_article, registered via @server.tool() decorator. Delegates to WikipediaClient.get_article and ensures dict return.
    @server.tool()
    def get_article(title: str) -> Dict[str, Any]:
        """
        Get the full content of a Wikipedia article.
    
        Returns a dictionary containing article details or an error message
        if retrieval fails.
        """
        logger.info(f"Tool: Getting article: {title}")
        article = wikipedia_client.get_article(title)
        # Ensure we always return a dictionary
        return article or {"title": title, "exists": False, "error": "Unknown error retrieving article"}
  • Core implementation of get_article in WikipediaClient, fetches page using wikipediaapi, extracts summary, text, sections, categories, links.
    def get_article(self, title: str) -> Dict[str, Any]:
        """
        Get the full content of a Wikipedia article.
    
        Args:
            title: The title of the Wikipedia article.
    
        Returns:
            A dictionary containing the article information.
        """
        try:
            page = self.wiki.page(title)
    
            if not page.exists():
                return {"title": title, "exists": False, "error": "Page does not exist"}
    
            # Get sections
            sections = self._extract_sections(page.sections)
    
            # Get categories
            categories = [cat for cat in page.categories.keys()]
    
            # Get links
            links = [link for link in page.links.keys()]
    
            return {
                "title": page.title,
                "pageid": page.pageid,
                "summary": page.summary,
                "text": page.text,
                "url": page.fullurl,
                "sections": sections,
                "categories": categories,
                "links": links[:100],  # Limit to 100 links to avoid too much data
                "exists": True,
            }
        except Exception as e:
            logger.error(f"Error getting Wikipedia article: {e}")
            return {"title": title, "exists": False, "error": str(e)}
  • The @server.tool() decorator registers the get_article function as an MCP tool.
    @server.tool()
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool 'Returns a dictionary containing article details or an error message if retrieval fails,' which adds some context about output and error handling. However, it lacks details on performance (e.g., rate limits), permissions, or side effects, which are critical for a tool interacting with an external API like Wikipedia.

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 front-loaded, with the first sentence clearly stating the purpose. The second sentence adds useful information about the return format and error handling. Both sentences earn their place, making it efficient without unnecessary details, though it could be slightly more structured by explicitly addressing parameters.

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 that there is an output schema (which likely defines the return dictionary structure), the description doesn't need to detail return values, and it adequately covers the basic operation. However, with no annotations and low schema coverage for parameters, the description lacks context on usage guidelines, parameter semantics, and behavioral traits like error conditions or API limitations, making it incomplete for optimal agent use.

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 1 parameter with 0% description coverage, so the schema provides no semantic information. The description does not mention the 'title' parameter at all, failing to explain what it represents (e.g., the article title to retrieve) or any constraints (e.g., formatting requirements). Since schema coverage is low, the description should compensate but does not, resulting in a baseline score due to the lack of added value.

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's purpose: 'Get the full content of a Wikipedia article.' It specifies the verb ('Get') and resource ('full content of a Wikipedia article'), making the action clear. However, it doesn't explicitly differentiate from siblings like 'get_summary' or 'get_sections,' which also retrieve article content but in different forms, leaving room for ambiguity.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_summary' (for brief overviews), 'get_sections' (for structured content), and 'search_wikipedia' (for finding articles), there is no indication of when 'get_article' is preferred, such as for complete details or when other tools might be more appropriate. This lack of context could lead to misuse.

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