Skip to main content
Glama
xraywu

Wegene Assistant MCP Server

by xraywu

wegene-get-profiles

Retrieve all genetic testing profiles associated with your WeGene account to access and manage your DNA analysis data.

Instructions

Retrieve all the profiles under the current account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that fetches profiles from WeGene API using the access token stored in Redis, creates Profile objects, and returns a TextContent response along with the profiles list or an error message.
    async def wegene_get_profiles() -> tuple[list[TextContent], list[Profile] | None]:
        # Get access token from Redis
        access_token = redis_db.get('wegene_access_token')
        if not access_token:
            return [
                TextContent(
                    type="text",
                    text="Error: No valid user access token. Please use wegene-oauth tool first."
                )
            ], None
    
        # Make API request to get profiles
        try:
            headers = {
                "Authorization": f"Bearer {access_token.decode('utf-8')}"
            }
            async with httpx.AsyncClient() as client:
                response = await client.get(
                    "https://api.wegene.com/user/",
                    headers=headers
                )
                response.raise_for_status()
                
                # Parse response and create new profiles list
                data = response.json()
                new_profiles = [
                    Profile(
                        name=profile["name"],
                        gender=str(profile["sex"]),
                        profile_id=profile["id"]
                    )
                    for profile in data["profiles"]
                ]
    
                profile_info = "\n".join(
                    f"Profile {i+1}: ID={profile.profile_id}, Name={profile.name}"
                    for i, profile in enumerate(new_profiles)
                )
                return [
                    TextContent(
                        type="text",
                        text=f"Successfully retrieved {len(new_profiles)} profiles(s):\n{profile_info}"
                    )
                ], new_profiles
        except httpx.HTTPStatusError as e:
            return [
                TextContent(
                    type="text",
                    text=f"Error: Failed to get profile {str(e)}"
                )
            ], None
  • Tool schema definition including name, description, and empty input schema (no parameters required).
    types.Tool(
        name="wegene-get-profiles",
        description="Retrieve all the profiles under the current account",
        inputSchema={
            "type": "object",
            "properties": {}
        },
    ),
  • Tool registration and dispatch in the call_tool handler: calls the wegene_get_profiles function, updates the global profiles list, sends resource list changed notification, and returns the result.
    elif name == "wegene-get-profiles":
        result, new_profiles = await wegene_get_profiles()
        if new_profiles:
            profiles.clear()
            profiles.extend(new_profiles)
            await server.request_context.session.send_resource_list_changed()
        return result
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 'Retrieve all the profiles', implying a read-only operation, but doesn't specify details like whether it requires authentication (implied by 'current account'), rate limits, pagination, or what 'all' entails (e.g., scope or limitations). This leaves significant gaps in understanding the tool's behavior.

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 directly states the tool's purpose without any wasted words. It's front-loaded with the key action and resource, making it efficient and easy to parse for an agent.

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 has 0 parameters, no annotations, and no output schema, the description is minimally adequate but incomplete. It explains what the tool does but lacks details on behavior (e.g., authentication needs, data format) and doesn't differentiate from siblings. For a simple retrieval tool, it meets basic needs but could benefit from more context.

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 tool has 0 parameters, and schema description coverage is 100%, so there's no need for parameter details in the description. The baseline for this scenario is 4, as the description doesn't need to compensate for missing param info, and it appropriately avoids unnecessary parameter explanations.

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 ('Retrieve') and resource ('profiles under the current account'), making the purpose understandable. However, it lacks differentiation from sibling tools like 'wegene-get-report' or 'wegene-get-report-info', which might also retrieve data but for different resources, so it doesn't fully distinguish itself.

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 like 'wegene-get-report' or 'wegene-get-report-info'. It doesn't mention any prerequisites, exclusions, or specific contexts for usage, 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