Skip to main content
Glama
xraywu

Wegene Assistant MCP Server

by xraywu

wegene-get-profiles

Retrieve all genetic profiles associated with your WeGene account to analyze and manage your DNA report data using OAuth and API integration.

Instructions

Retrieve all the profiles under the current account

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • Core handler function that retrieves user profiles from the WeGene API using the stored access token, parses the response into Profile objects, constructs a success message listing the profiles, or returns an error if token missing or API fails.
    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 registration in list_tools(), including name, description, and empty input schema.
    types.Tool( name="wegene-get-profiles", description="Retrieve all the profiles under the current account", inputSchema={ "type": "object", "properties": {} }, ),
  • Dispatch handler in call_tool() that invokes wegene_get_profiles(), updates global profiles list if new profiles found, notifies session of resource changes, 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
  • Input schema definition for the tool (no required properties).
    inputSchema={ "type": "object", "properties": {} }, ),

Other Tools

Related 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