Skip to main content
Glama
Schimmilab

Withings MCP Server

by Schimmilab

get_authorization_url

Get an OAuth2 authorization URL to authenticate users with Withings, granting access to health data such as body measurements, activity, and sleep analysis.

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

  • Handler for the get_authorization_url tool: extracts scope from arguments, calls auth.get_authorization_url(), and returns a TextContent response with the URL.
    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.",
            )
        ]
  • Tool registration and input schema definition for get_authorization_url, with an optional 'scope' string 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",
                },
            },
        },
    ),
  • Helper function on WithingsAuth class that constructs the OAuth2 authorization URL using client_id, redirect_uri, scope, and a static state.
    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}"
  • Tool registered in the list_tools() handler as part of the MCP tool listing.
        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",
                    },
                },
            },
        ),
    ]
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavioral traits. It only states that the tool gets a URL, with no mention of side effects (none expected), rate limits, or user interaction required. This leaves the agent with minimal understanding of the tool's behavior beyond the basic action.

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, front-loaded sentence with no unnecessary words. Every part is essential, making it highly efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one optional param, no output schema), the description is largely sufficient. However, it could briefly mention that the URL requires user interaction to complete authentication, but this is not critical for a tool that simply returns a URL.

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 coverage is 100% for the single parameter 'scope', and the description does not add any extra meaning beyond the schema's own description. As per guidelines, with high schema coverage the baseline is 3, and the description provides no additional value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get'), the resource ('OAuth2 authorization URL'), and the target ('authenticate with Withings'). It is specific and easily distinguishable from sibling tools which are all data retrieval functions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide explicit guidance on when to use this tool vs alternatives, such as indicating it should be called first before other API calls. The context implies it is for authentication, but no direct instructions or exclusions are given.

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

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