Skip to main content
Glama

get_authorization_url

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

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 get_authorization_url: 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}"
  • Input schema for the get_authorization_url tool, defining the optional 'scope' parameter.
    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", }, }, },
  • Tool registration in the MCP server's list_tools() method.
    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 call_tool dispatch handler for get_authorization_url, which calls the auth method and returns formatted response.
    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