Skip to main content
Glama
xraywu

Wegene Assistant MCP Server

by xraywu

wegene-oauth

Authorize user accounts via WeGene's OAuth2 protocol to obtain access tokens for genetic report analysis and data management.

Instructions

Authorizing a user's account using WeGene Open API with oAuth2 protocol and retrieve a valid access token for further use

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async handler function `wegene_oauth()` that executes the tool: deletes prior token, prepares OAuth URL, opens browser, polls Redis for new access token up to 120 seconds, returns success or timeout message.
    async def wegene_oauth():
    
        redis_db.delete('wegene_access_token')
    
        # Initialize OAuth2 client
        client = WebApplicationClient(WEGENE_CLIENT_ID)
        
        # Prepare authorization URL
        authorization_url = client.prepare_request_uri(
            WEGENE_AUTH_URL,
            redirect_uri=REDIRECT_URI,
            scope="basic names athletigen skin psychology risk health"
        )
    
        webbrowser.open(authorization_url)
        
        # Poll for access token for 120 seconds
        start_time = time.time()
        while time.time() - start_time < 120:
            if redis_db.exists('wegene_access_token'):
                return [
                    TextContent(
                        type="text",
                        text="User authorization succeeded and access token retrieved. Continue to retrieve user profiles.",
                    )
                ]
            await asyncio.sleep(1)
        
        return [
            TextContent(
                type="text",
                text="Error: User authorization failed in 120 seconds. Please try again."
            )
        ]
  • Registers the 'wegene-oauth' tool in @server.list_tools() with name, description, and empty input schema (no parameters required).
    types.Tool(
        name="wegene-oauth",
        description="Authorizing a user's account using WeGene Open API with oAuth2 protocol and retrieve a valid access token for further use",
        inputSchema={
            "type": "object",
            "properties": {},
        },
    ),
  • Dispatches tool calls in @server.call_tool(): invokes the `wegene_oauth()` handler when name is 'wegene-oauth'.
    if name == "wegene-oauth":
        return await wegene_oauth()
  • Imports the `wegene_oauth` handler function from oauth_tool.py.
    from .tools.oauth_tool import wegene_oauth
  • Defines the input schema for 'wegene-oauth' tool: empty object (no input parameters).
    inputSchema={
        "type": "object",
        "properties": {},
    },
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 mentions oAuth2 protocol and token retrieval, which implies authentication and potential user interaction, but doesn't detail behavioral traits such as whether this initiates a user consent flow, requires specific permissions, involves rate limits, or handles errors. For an authentication tool with zero annotation coverage, this leaves significant gaps in understanding how it 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, well-structured sentence that efficiently conveys the core functionality without unnecessary details. It is front-loaded with the main action and outcome, making it easy to understand quickly. Every word earns its place, and there is no wasted information.

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

Completeness3/5

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

Given the tool's complexity (authentication with oAuth2), lack of annotations, and no output schema, the description is minimally adequate. It explains what the tool does but doesn't cover important contextual details like the token's scope, expiration, or how to use it with sibling tools. For an authentication tool, more completeness is expected to guide proper integration.

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 appropriately focuses on the tool's purpose. A baseline of 4 is applied since no parameters exist, and the description doesn't mislead about inputs.

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: 'Authorizing a user's account using WeGene Open API with oAuth2 protocol and retrieve a valid access token for further use.' It specifies the action (authorizing via oAuth2) and the outcome (retrieving an access token). However, it doesn't explicitly distinguish this from its siblings (e.g., wegene-get-profiles, wegene-get-report), which focus on data retrieval rather than authentication.

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 by stating the token is 'for further use,' suggesting this tool should be invoked before other tools that require authentication. However, it doesn't provide explicit guidance on when to use it versus alternatives (e.g., if re-authentication is needed) or any prerequisites. The context is clear but lacks detailed exclusions or comparisons.

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/xraywu/mcp-wegene-assistant'

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