Skip to main content
Glama
stefanstranger

mcp-server-vanmoof

get_customer_data

Retrieve authenticated customer data including bike details, rider preferences, and weekly rides from the VanMoof API for integration with AI agents.

Instructions

    Retrieves customer data from the vanMoof API.

    Returns:
        The rider vanMoof's customer data if authentication is successful, otherwise None.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler implementation for the 'get_customer_data' MCP tool. Decorated with @mcp.tool() for automatic registration. Authenticates using helper method and fetches customer data from the VanMoof API.
    @mcp.tool()
    # Function to get customer data
    def get_customer_data() -> Dict[str, Any]:
        """
        Retrieves customer data from the vanMoof API.
    
        Returns:
            The rider vanMoof's customer data if authentication is successful, otherwise None.
        """
        # Get the Bearer token from the authenticate method
        token = VanMoofAPI.get_vanmoof_token(VANMOOF_USERNAME, VANMOOF_PASSWORD)
        if not token:
            return {"error": "Authentication failed"}
    
        url = "https://my.vanmoof.com/api/v8/getCustomerData"
        headers = {
            "authorization": f"Bearer {token}",
            "api-key": "fcb38d47-f14b-30cf-843b-26283f6a5819"
        }
        response = requests.get(url, headers=headers)
        return response.json()
  • Supporting helper method 'get_vanmoof_token' in VanMoofAPI class, called by the tool handler to authenticate and obtain the Bearer token required for the API request.
    def get_vanmoof_token(username, password):
        """
        Authenticates with the VanMoof API and retrieves an access token.
    
        Args:
            username: The user's VanMoof email address.
            password: The user's VanMoof password.
    
        Returns:
            The access token string if authentication is successful, otherwise None.
        """
        api_key = 'fcb38d47-f14b-30cf-843b-26283f6a5819'
        uri_prefix = 'https://my.vanmoof.com/api/v8'
        auth_url = f'{uri_prefix}/authenticate'
    
        # Prepare Basic Authentication credentials
        auth_string = f"{username}:{password}"
        encoded_auth_string = base64.b64encode(auth_string.encode('ascii')).decode('ascii')
    
        headers = {
            'Authorization': f'Basic {encoded_auth_string}',
            'Api-Key': api_key
        }
    
        try:
            response = requests.post(auth_url, headers=headers)
            response.raise_for_status()  # Raise an exception for bad status codes (4xx or 5xx)
    
            # Parse the JSON response and extract the token
            token = response.json().get('token')
            return token
    
        except requests.exceptions.RequestException as e:
            print(f"An error occurred during the API request: {e}")
            return None
        except Exception as e:
            print(f"An unexpected error occurred: {e}")
            return None
  • server.py:115-115 (registration)
    The @mcp.tool() decorator registers the get_customer_data function as an MCP tool.
    @mcp.tool()
Behavior3/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 adds some context by mentioning authentication requirements and the return value (customer data or None), but lacks details on rate limits, error handling, data format, or other operational traits. This is a minimal but adequate disclosure for a simple retrieval tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with two sentences: one stating the purpose and one detailing the return behavior. It's front-loaded with the core function and avoids redundancy, though the formatting includes extra whitespace that slightly detracts from structure.

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's simplicity (0 parameters, no output schema, no annotations), the description is complete enough for basic use. It covers the purpose and return conditions, but could benefit from more context on data scope or sibling differentiation to fully guide the agent in a server with multiple retrieval tools.

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 the schema description coverage is 100%, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a high baseline score for not adding unnecessary information.

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 tool's purpose with a specific verb ('Retrieves') and resource ('customer data from the vanMoof API'), making it easy to understand what it does. However, it doesn't explicitly differentiate this tool from its siblings (like get_rider_preferences or get_rides_summary), which would require a more specific scope or comparison.

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. It mentions authentication success/failure, but doesn't specify contexts, prerequisites, or exclusions compared to sibling tools, leaving the agent to infer usage 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/stefanstranger/mcp-server-vanmoof'

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