Skip to main content
Glama

get_top_articles

Retrieve trending Dev.to articles to discover popular developer content and insights.

Instructions

Get the top articles from Dev.to

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.py:28-32 (handler)
    The handler function for the 'get_top_articles' tool. It fetches top articles from the Dev.to API endpoint '/articles' using the helper fetch_from_api and formats the first 10 using format_articles.
    @mcp.tool()
    async def get_top_articles() -> str:
        """Get the top articles from Dev.to"""
        articles = await fetch_from_api("/articles")
        return format_articles(articles[:10])  # Limiting to 10 for readability
  • Helper function used by get_top_articles to make HTTP requests to the Dev.to API.
    async def fetch_from_api(path: str, params: dict = None) -> dict:
        """Helper function to fetch data from Dev.to API"""
        async with httpx.AsyncClient() as client:
            url = f"{BASE_URL}{path}"
            response = await client.get(url, params=params, timeout=10.0)
            response.raise_for_status()
            return response.json()
  • Helper function used by get_top_articles to format the list of articles into a readable markdown string.
    def format_articles(articles: list) -> str:
        """Format a list of articles for display"""
        if not articles:
            return "No articles found."
        
        result = "# Dev.to Articles\n\n"
        for article in articles:
            title = article.get("title", "Untitled")
            author = article.get("user", {}).get("name", "Unknown Author")
            published_date = article.get("readable_publish_date", "Unknown date")
            article_id = article.get("id", "")
            tags = article.get("tags", "")
            
            result += f"## {title}\n"
            result += f"ID: {article_id}\n"
            result += f"Author: {author}\n"
            result += f"Published: {published_date}\n"
            result += f"Tags: {tags}\n"
            result += f"Description: {article.get('description', 'No description available.')}\n\n"
        
        return result
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 action but doesn't reveal any behavioral traits such as rate limits, authentication requirements, pagination, or what 'top' entails (e.g., sorting criteria, number of articles returned). This leaves significant gaps for an agent to understand how the tool behaves.

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 a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it highly concise and well-structured for quick understanding.

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

Completeness2/5

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

Given the complexity of fetching 'top' articles (which could involve sorting, filtering, or ranking logic), the description is incomplete. With no annotations and no output schema, it fails to explain what 'top' means, how many articles are returned, or the format of the response. This leaves critical context missing for effective tool use.

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 0 parameters with 100% coverage, meaning there are no parameters to document. The description doesn't need to add parameter semantics, so it meets the baseline expectation. No additional value is required or provided beyond the schema.

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 verb 'Get' and the resource 'top articles from Dev.to', making the purpose immediately understandable. However, it doesn't distinguish this tool from sibling tools like 'get_latest_articles' or 'get_articles_by_tag', which reduces clarity about what makes 'top' articles different.

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 like 'get_latest_articles' or 'search_articles'. There's no mention of what 'top' means (e.g., by views, likes, recency) or any context for selecting this tool over siblings, leaving usage ambiguous.

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/Arindam200/devto-mcp'

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