Skip to main content
Glama
Azhar-obenan

Obenan MCP Server

by Azhar-obenan

fetch_my_locations

Retrieve location data from Obenan API using an access token, with optional filtering by group ID for targeted results.

Instructions

Fetch locations from Obenan API using the access token

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
access_tokenNoAccess token for Obenan API. Optional if OBENAN_LOGIN_ACCESS_TOKEN environment variable is set.
group_idNoGroup ID to filter locations by. Optional.

Implementation Reference

  • The handle_fetch_locations function implements the logic to fetch and format locations from the Obenan API for the 'fetch_my_locations' tool.
    async def handle_fetch_locations(
        arguments: dict[str, Any] | None
    ) -> list[types.TextContent]:
        # Get token from environment variable or from arguments
        import os
        
        access_token = os.environ.get("OBENAN_LOGIN_ACCESS_TOKEN")
        
        # Add debug info about the token (just showing first/last few characters for security)
        token_debug = ""
        if access_token:
            if len(access_token) > 10:
                token_debug = f"{access_token[:5]}...{access_token[-5:]}"
            else:
                token_debug = "[too short to truncate safely]"
        else:
            token_debug = "[None - Token not found]"
        
        try:
            # Direct API call with simplified URL
            url = "https://stagingapi.obenan.com/api/v1/location/search?isLocationPage=false&isListingPage=true"
            headers = {"Authorization": f"Bearer {access_token}"}
            
            response = requests.get(url, headers=headers)
            
            if response.status_code == 200:
                data = response.json()
                
                # Simple output format focusing just on location names
                formatted_response = f"✅ Location Names: (Token: {token_debug})\n\n"
                
                # Check for data.results path
                if data and isinstance(data, dict) and "data" in data:
                    if isinstance(data["data"], dict) and "results" in data["data"]:
                        locations = data["data"]["results"]
                        
                        if locations and isinstance(locations, list):
                            for i, loc in enumerate(locations):
                                name = loc.get("name", "Unknown")
                                formatted_response += f"{i+1}. {name}\n"
                        else:
                            formatted_response += "No locations found in results.\n"
                    else:
                        formatted_response += "Results field not found in data structure.\n"
                else:
                    formatted_response += "No data field found in response.\n"
                    
                # Add response debug info
                formatted_response += f"\n===DEBUG INFO===\n"
                formatted_response += f"Response Keys: {list(data.keys()) if isinstance(data, dict) else 'Not a dict'}\n"
                if isinstance(data, dict) and "data" in data:
                    data_keys = list(data["data"].keys()) if isinstance(data["data"], dict) else "Not a dict"
                    formatted_response += f"Data Keys: {data_keys}\n"
                    if isinstance(data["data"], dict) and "results" in data["data"]:
                        location_count = len(data["data"]["results"]) if isinstance(data["data"]["results"], list) else 0
                        formatted_response += f"Location Count: {location_count}\n"
                        
                return [types.TextContent(type="text", text=formatted_response)]
    
            else:
                error_msg = f"❌ Failed to fetch locations: HTTP {response.status_code}\n{response.text[:500]}"
                return [types.TextContent(type="text", text=error_msg)]
                
        except Exception as e:
            error_trace = traceback.format_exc()
            return [types.TextContent(
                type="text",
                text=f"🚨 Error fetching locations: {str(e)}\n\n{error_trace[:500]}"
            )]
  • The 'fetch_my_locations' tool is defined and registered within the list_tools() function.
    types.Tool(
        name="fetch_my_locations",
        description="Fetch locations from Obenan API using the access token",
        inputSchema={
            "type": "object",
            "properties": {
                "access_token": {"type": "string", "description": "Access token for Obenan API. Optional if OBENAN_LOGIN_ACCESS_TOKEN environment variable is set."},
                "group_id": {"type": "string", "description": "Group ID to filter locations by. Optional."}
            },
            "required": []
        },
    ),
Behavior2/5

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

With no annotations provided, the description carries full disclosure burden but provides minimal behavioral context. It mentions authentication (access token) but omits what data structure is returned, pagination behavior, rate limits, or error conditions. The agent cannot determine if this is a safe read operation or what fields the locations contain.

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?

Extremely concise at 9 words in a single sentence. Front-loaded with verb 'Fetch'. While no words are wasted, the brevity crosses into under-specification given the lack of annotations and output schema. Appropriate density but insufficient length for the complexity.

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

Completeness2/5

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

Given the presence of multiple location-related siblings and no output schema, the description inadequately prepares the agent for tool selection. It fails to explain return values, distinguish this list operation from single-record retrieval, or document authentication requirements beyond the parameter itself.

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?

Input schema has 100% description coverage, establishing a baseline of 3. The description adds no additional parameter semantics beyond mentioning the access token (already documented in schema). It does not explain the relationship between group_id and the returned locations or provide usage examples.

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

Purpose3/5

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

The description states the basic action (Fetch locations) and target API (Obenan), matching the tool name's intent. However, it fails to clarify the 'my' aspect (user-specific locations vs. public/global) or distinguish from siblings like 'get_location_details' and 'search_locations_by_name', leaving ambiguity about scope and return cardinality.

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?

No guidance provided on when to use this tool versus the three sibling location tools. The description does not indicate whether this returns a list vs. single record, or when to prefer searching by name versus fetching 'my' locations.

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/Azhar-obenan/review-analyzer-mcp-server'

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