Skip to main content
Glama
Nikhil-Patil-RI

Github-Oauth MCP Server

get_user_profile

Retrieve authenticated GitHub user profile data to access account information and verify identity for authorized API interactions.

Instructions

Fetch the authenticated user's GitHub profile.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_user_profile' tool. It checks for an access token, makes a request to the GitHub /user endpoint, and returns a formatted string with the user's profile details including username, name, email, repos, followers, etc.
    @mcp.tool()
    async def get_user_profile() -> str:
        """Fetch the authenticated user's GitHub profile."""
        global access_token
    
        if not access_token:
            return "You are not authorized. Please authorize first."
    
        url = f"{GITHUB_API_BASE}/user"
        headers = {
            "Authorization": f"Bearer {access_token}",
            "User-Agent": USER_AGENT,
        }
        data = await make_request(url, headers)
        if not data:
            return "Unable to fetch user profile."
    
        return (
            f"Username: {data.get('login', 'N/A')}\n"
            f"Name: {data.get('name', 'N/A')}\n"
            f"Email: {data.get('email', 'N/A')}\n"
            f"Public Repositories: {data.get('public_repos', 'N/A')}\n"
            f"Followers: {data.get('followers', 'N/A')}\n"
            f"Following: {data.get('following', 'N/A')}\n"
            f"Profile URL: {data.get('html_url', 'N/A')}"
        )
  • Helper utility function used by get_user_profile (and others) to perform authenticated HTTP GET requests to the GitHub API.
    async def make_request(url: str, headers: dict[str, str], params: dict[str, str] = None) -> Optional[dict[str, Any]]:
        """Make an HTTP GET request with error handling."""
        async with httpx.AsyncClient() as client:
            try:
                response = await client.get(url, headers=headers, params=params, timeout=30.0)
                response.raise_for_status()
                return response.json()
            except Exception as e:
                print(f"Request failed: {e}")
                return None
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 this is a 'fetch' operation, implying it's likely read-only and non-destructive, but doesn't confirm this or address other behavioral aspects like rate limits, authentication requirements beyond 'authenticated', error handling, or response format. The description adds minimal value beyond the basic action, missing key details for safe and effective use.

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, clear sentence that front-loads the essential information ('fetch the authenticated user's GitHub profile') with zero wasted words. It's appropriately sized for a simple tool with no parameters, making it easy to parse quickly without sacrificing 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 lack of annotations and output schema, the description is incomplete for effective tool use. It doesn't explain what data the profile includes, how authentication is handled, or potential errors, leaving significant gaps in understanding the tool's behavior and results. For a tool that likely returns user data, more context is needed to compensate for the missing structured information.

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, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, avoiding redundancy. This meets the baseline for tools with no parameters, as the description focuses on the tool's purpose rather than unnecessary parameter details.

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 action ('fetch') and target resource ('authenticated user's GitHub profile'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'get_user_repositories', but the specificity of 'profile' versus 'repositories' provides implicit distinction. The description avoids tautology by not merely restating the tool name.

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

Usage Guidelines3/5

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

The description implies usage context through 'authenticated user's', suggesting this tool should be used when the user is logged in, but it doesn't provide explicit guidance on when to use this versus alternatives like 'get_user_repositories' or prerequisites like needing authorization first. The context is implied rather than stated clearly, leaving some ambiguity about optimal usage scenarios.

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/Nikhil-Patil-RI/MCP-Github-Oauth'

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