Skip to main content
Glama
xraywu

Wegene Assistant MCP Server

by xraywu

wegene-get-report

Retrieve genetic test reports from WeGene profiles using specific report endpoints, IDs, and profile identifiers to access personalized genetic data.

Instructions

Get a specific genetic test report from a profile

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
report_endpointYesThe endpoint of the report
report_idYesThe ID of the report
profile_idYesThe ID of the profile

Implementation Reference

  • Core handler function that performs the HTTP POST request to WeGene API to retrieve the genetic report JSON using the provided parameters and stored access token.
    async def get_wegene_report(report_endpoint: str, report_id: str, profile_id: str) -> str:
        """
        Read report from WeGene Open API
        :param uri: resource uri, wegene://{report_endpoint}/{report_id}/{profile_id}
        :return: JSON string of the results
        """
    
        # Get WeGene access token
        access_token = redislite.Redis(os.getenv('REDIS_DB_PATH')).get('wegene_access_token')
        if not access_token:
            raise ValueError("No valid user access token. Please use wegene-oauth tool first.")
        
        # Prepare request
        url = f"https://api.wegene.com/{report_endpoint}/{profile_id}"
        headers = {
            "Authorization": f"Bearer {access_token.decode('utf-8')}",
            "Content-Type": "application/json"
        }
        data = {
            "report_id": report_id
        }
        
        # Call WeGene API
        async with httpx.AsyncClient() as client:
            response = await client.post(url, headers=headers, json=data)
            if response.status_code != 200:
                raise ValueError(f"Failed to retrieve report: {response.status_code} {response.text}")
            
            return response.text
  • MCP server.call_tool handler that dispatches the tool call by extracting input arguments and invoking the core get_wegene_report function.
    elif name == "wegene-get-report":
        if not arguments:
            raise ValueError("Missing arguments")
        return [
            types.TextContent(
                type="text",
                text=await get_wegene_report(
                    arguments["report_endpoint"],
                    arguments["report_id"],
                    arguments["profile_id"]
                )
            )
        ]
  • Input schema definition for the wegene-get-report tool, specifying required properties: report_endpoint, report_id, profile_id.
    types.Tool(
        name="wegene-get-report",
        description="Get a specific genetic test report from a profile",
        inputSchema={
            "type": "object",
            "properties": {
                "report_endpoint": {
                    "type": "string",
                    "description": "The endpoint of the report"
                },
                "report_id": {
                    "type": "string",
                    "description": "The ID of the report"
                },
                "profile_id": {
                    "type": "string",
                    "description": "The ID of the profile"
                }
            },
            "required": ["report_endpoint", "report_id", "profile_id"]
        },
    )
  • Registration of the wegene-get-report tool in the MCP server's list_tools method, including all tools.
    return [
        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": {},
            },
        ),
        types.Tool(
            name="wegene-get-profiles",
            description="Retrieve all the profiles under the current account",
            inputSchema={
                "type": "object",
                "properties": {}
            },
        ),
        types.Tool(
            name="wegene-get-report-info",
            description="Get all available report information",
            inputSchema={
                "type": "object",
                "properties": {}
            },
        ),
        types.Tool(
            name="wegene-get-report",
            description="Get a specific genetic test report from a profile",
            inputSchema={
                "type": "object",
                "properties": {
                    "report_endpoint": {
                        "type": "string",
                        "description": "The endpoint of the report"
                    },
                    "report_id": {
                        "type": "string",
                        "description": "The ID of the report"
                    },
                    "profile_id": {
                        "type": "string",
                        "description": "The ID of the profile"
                    }
                },
                "required": ["report_endpoint", "report_id", "profile_id"]
            },
        )
    ]
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 tool 'Get's a report, implying a read operation, but doesn't cover aspects like authentication needs (though 'wegene-oauth' hints at this), rate limits, error handling, or what the output contains. 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized for a simple retrieval tool, with no wasted information.

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 three required parameters, the description is incomplete. It doesn't explain what the tool returns (e.g., report content format), authentication requirements (implied by sibling 'wegene-oauth'), or behavioral traits like error cases. For a tool with this complexity and lack of structured data, more context is needed.

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?

Schema description coverage is 100%, so the schema already documents all three parameters (report_endpoint, report_id, profile_id) with basic descriptions. The description adds no additional meaning beyond implying these are needed to retrieve a report, aligning with the baseline score when the schema handles parameter documentation adequately.

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 ('Get') and resource ('specific genetic test report from a profile'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'wegene-get-report-info' or 'wegene-get-profiles', which likely retrieve different types of genetic data or metadata.

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 is provided on when to use this tool versus alternatives like 'wegene-get-report-info' or 'wegene-get-profiles'. The description implies usage for retrieving a report but doesn't specify contexts, prerequisites, or exclusions, leaving the agent to infer based on tool names 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/xraywu/mcp-wegene-assistant'

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