Skip to main content
Glama

get_links

Extract all hyperlinks from a Wikipedia article to identify related topics and references for research or content analysis.

Instructions

Get the links contained within a Wikipedia article.

Returns a dictionary with the article title and list of links.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for get_links, decorated with @server.tool() for registration. Takes article title as input, calls WikipediaClient.get_links, and returns dict with title and list of links.
    @server.tool()
    def get_links(title: str) -> Dict[str, Any]:
        """
        Get the links contained within a Wikipedia article.
    
        Returns a dictionary with the article title and list of links.
        """
        logger.info(f"Tool: Getting links for: {title}")
        links = wikipedia_client.get_links(title)
        return {"title": title, "links": links}
  • Core helper method in WikipediaClient that implements get_links by fetching the Wikipedia page via wikipediaapi.Wikipedia.page() and extracting page.links.keys() as list of link titles.
    def get_links(self, title: str) -> List[str]:
        """
        Get the links in a Wikipedia article.
    
        Args:
            title: The title of the Wikipedia article.
    
        Returns:
            A list of links.
        """
        try:
            page = self.wiki.page(title)
    
            if not page.exists():
                return []
    
            return [link for link in page.links.keys()]
        except Exception as e:
            logger.error(f"Error getting Wikipedia links: {e}")
            return []
  • The @server.tool() decorator registers the get_links function as an MCP tool.
    @server.tool()
  • Type hints and docstring define the input schema (title: str) and output schema (Dict[str, Any] with title and links).
    def get_links(title: str) -> Dict[str, Any]:
        """
        Get the links contained within a Wikipedia article.
    
        Returns a dictionary with the article title and list of links.
        """
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool returns a dictionary with article title and list of links, which adds some context beyond the input schema. However, it doesn't cover critical aspects like error handling, rate limits, authentication needs, or whether it's read-only (implied but not stated). For a tool with zero annotation coverage, this is a significant gap.

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 front-loaded and efficient: two sentences that directly state the purpose and return value without waste. Every sentence earns its place by providing essential information, making it appropriately sized and well-structured.

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 (1 parameter, no nested objects) and the presence of an output schema (which handles return values), the description is reasonably complete. It covers the core functionality and output structure. However, with no annotations and minimal parameter details, it could benefit from more behavioral context, but the output schema reduces the burden.

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

Parameters4/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 description must compensate. It implies the 'title' parameter is the Wikipedia article title to fetch links from, adding meaning beyond the bare schema. Since there are no parameters beyond this, the description adequately covers the single parameter's semantics, earning a high score.

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 links contained within a Wikipedia article.' It specifies the verb ('Get') and resource ('links within a Wikipedia article'), making the action explicit. However, it doesn't differentiate from sibling tools like 'get_article' or 'get_sections,' which might also retrieve article components, so it misses full sibling distinction.

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. It doesn't mention sibling tools like 'get_article' (which might include links) or 'search_wikipedia' (for finding articles), nor does it specify prerequisites or exclusions. Usage is implied by the purpose but lacks explicit context.

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