Skip to main content
Glama

get_authorization_url

Generate an OAuth2 authorization URL to authenticate users with Withings Health API for accessing body measurements, activity data, and health metrics.

Instructions

Get OAuth2 authorization URL to authenticate with Withings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNoOAuth scopes (comma-separated): user.info, user.metrics, user.activityuser.info,user.metrics,user.activity

Implementation Reference

  • Core implementation of the get_authorization_url tool. Constructs the OAuth2 authorization URL using client credentials and provided scope.
    def get_authorization_url(self, scope: str = "user.info,user.metrics,user.activity") -> str: """Generate OAuth2 authorization URL.""" params = { "response_type": "code", "client_id": self.client_id, "redirect_uri": self.redirect_uri, "scope": scope, "state": "random_state_string" } query = "&".join(f"{k}={v}" for k, v in params.items()) return f"{self.AUTH_URL}?{query}"
  • Registers the get_authorization_url tool with MCP server including input schema for optional scope parameter.
    Tool( name="get_authorization_url", description="Get OAuth2 authorization URL to authenticate with Withings", inputSchema={ "type": "object", "properties": { "scope": { "type": "string", "description": "OAuth scopes (comma-separated): user.info, user.metrics, user.activity", "default": "user.info,user.metrics,user.activity", }, }, }, ),
  • MCP tool call handler that extracts scope from arguments, calls the auth method, and formats the response as TextContent.
    if name == "get_authorization_url": scope = arguments.get("scope", "user.info,user.metrics,user.activity") url = self.auth.get_authorization_url(scope) return [ TextContent( type="text", text=f"Please visit this URL to authorize:\n\n{url}\n\nAfter authorization, you'll receive a code. Use it to get access tokens.", ) ]

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/schimmmi/withings-mcp-server'

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