Skip to main content
Glama

get_articles_by_username

Retrieve articles published by a specific Dev.to author using their username to access their content portfolio.

Instructions

Get articles written by a specific user

Args:
    username: The username of the author

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYes

Implementation Reference

  • server.py:78-87 (handler)
    The handler function decorated with @mcp.tool() that implements the 'get_articles_by_username' tool. It fetches articles by the given username from the Dev.to API using the shared fetch_from_api helper and formats the results with format_articles.
    @mcp.tool()
    async def get_articles_by_username(username: str) -> str:
        """
        Get articles written by a specific user
        
        Args:
            username: The username of the author
        """
        articles = await fetch_from_api("/articles", params={"username": username})
        return format_articles(articles[:10])
  • Shared helper function used by get_articles_by_username 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()
  • Shared helper function used by get_articles_by_username 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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Get articles') but doesn't describe traits like whether it's read-only (implied by 'get'), what happens if the username doesn't exist (e.g., returns empty list or error), rate limits, authentication needs, or output format (e.g., list of articles with basic details). This leaves significant gaps for a tool with no annotation coverage.

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 appropriately sized and front-loaded: the first sentence states the purpose clearly, followed by a structured 'Args' section. There's no wasted text, and it efficiently covers the essentials. However, it could be slightly more concise by integrating the parameter explanation into the main sentence without losing clarity.

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 tool's complexity (simple retrieval with one parameter), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'articles' entail (e.g., full content or summaries), how results are returned (e.g., paginated list), or error conditions. For a tool with no structured data to rely on, more context is needed to be fully helpful.

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 description adds minimal semantics beyond the input schema. It includes an 'Args' section that documents the single parameter 'username' with a brief explanation ('The username of the author'), which provides basic context. However, with 0% schema description coverage, this doesn't fully compensate—it lacks details like format constraints (e.g., case sensitivity) or examples. The baseline is 3 due to the single parameter, but the added value is limited.

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 articles written by a specific user.' It specifies the verb ('Get') and resource ('articles'), and distinguishes it from siblings like 'get_article_by_id' or 'get_articles_by_tag' by focusing on authorship. However, it doesn't explicitly differentiate from 'get_user_info' or 'search_articles' in terms of scope or output format.

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 prerequisites, such as whether the username must exist or be valid, or compare it to siblings like 'search_articles' for broader queries or 'get_user_info' for user metadata. Usage is implied by the name but not explicitly stated.

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