Skip to main content
Glama

get_user_info

Retrieve user profile details from Dev.to by providing a username to access information such as bio, articles, and activity.

Instructions

Get information about a Dev.to user

Args:
    username: The username of the user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYes

Implementation Reference

  • The handler function for the 'get_user_info' tool, registered with @mcp.tool(). It fetches user data from the Dev.to API and formats the profile, handling not-found errors.
    @mcp.tool()
    async def get_user_info(username: str) -> str:
        """
        Get information about a Dev.to user
        
        Args:
            username: The username of the user
        """
        try:
            user = await fetch_from_api(f"/users/{username}")
            return format_user_profile(user)
        except httpx.HTTPStatusError as e:
            if e.response.status_code == 404:
                return f"User {username} not found."
            raise e
  • Helper function used by get_user_info to format the retrieved user profile into a markdown-formatted string.
    def format_user_profile(user: dict) -> str:
        """Format a user profile for display"""
        if not user:
            return "User not found."
        
        username = user.get("username", "Unknown")
        name = user.get("name", "Unknown")
        bio = user.get("summary", "No bio available.")
        twitter = user.get("twitter_username", "")
        github = user.get("github_username", "")
        website = user.get("website_url", "")
        location = user.get("location", "")
        joined = user.get("joined_at", "")
        
        result = f"# {name} (@{username})\n\n"
        result += f"Bio: {bio}\n\n"
        
        result += "## Details\n"
        if location:
            result += f"Location: {location}\n"
        if joined:
            result += f"Member since: {joined}\n"
        
        result += "\n## Links\n"
        if twitter:
            result += f"Twitter: @{twitter}\n"
        if github:
            result += f"GitHub: {github}\n"
        if website:
            result += f"Website: {website}\n"
        
        return result
  • General helper function used by get_user_info (and other tools) to make API requests to Dev.to.
    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()
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool retrieves information, implying a read-only operation, but doesn't disclose behavioral traits like authentication needs, rate limits, error conditions, or what specific information is returned. This is inadequate for a tool with zero 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 with the purpose in the first sentence. The Args section is clear but could be more integrated. No wasted sentences, though it lacks depth.

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 no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain return values, error handling, or behavioral context needed for effective tool use. This is a simple tool but requires more guidance for the agent.

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: it mentions 'username' as the parameter in the Args section, but the schema already documents this parameter with 0% coverage. Since schema coverage is low, the description doesn't compensate by explaining format, constraints, or examples. Baseline 3 applies as it doesn't add significant value 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 tool's purpose: 'Get information about a Dev.to user' specifies the verb ('Get information') and resource ('Dev.to user'). It distinguishes from siblings like article-related tools, but doesn't explicitly differentiate from potential user-related siblings not present in the list.

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?

No guidance on when to use this tool versus alternatives is provided. The description doesn't mention prerequisites, context for usage, or comparison with other tools. The agent must infer usage from the purpose alone.

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