Skip to main content
Glama
Azhar-obenan

Obenan MCP Server

by Azhar-obenan

get_location_details

Retrieve comprehensive information about a specific location using its unique ID, including details and properties from the Obenan MCP Server.

Instructions

Get detailed information about a specific location by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
location_idYesID of the location to get details for
access_tokenNoAccess token for Obenan API. Optional if OBENAN_LOGIN_ACCESS_TOKEN environment variable is set.

Implementation Reference

  • The handler function that executes the "get_location_details" tool.
    async def handle_location_details(
        arguments: dict[str, Any] | None
    ) -> list[types.TextContent]:
        # Get location ID from arguments
        location_id = arguments.get("location_id")
        if not location_id:
            return [types.TextContent(
                type="text", 
                text="❌ Error: Location ID is required to get location details"
            )]
        
        # Get token from environment variable or from arguments
        access_token = os.environ.get("OBENAN_LOGIN_ACCESS_TOKEN")
        if not access_token:
            return [types.TextContent(
                type="text", 
                text="❌ Error: Access token is required. Either provide it as an argument or set the OBENAN_LOGIN_ACCESS_TOKEN environment variable."
            )]
        
        try:
            # Make API call to get location details - updated URL to correct endpoint
            url = f"https://stagingapi.obenan.com/api/v1/location/{location_id}"
            headers = {
                "Authorization": f"Bearer {access_token}",
                "Origin": "https://stagingapp.obenan.com"
            }
            
            response = requests.get(url, headers=headers)
            
            if response.status_code == 200:
                data = response.json()
                
                # Format the response for better readability
                formatted_response = f"✅ Location Details for ID: {location_id}\n\n"
                
                # Extract and format key information based on the actual response structure
                if data and isinstance(data, dict) and "data" in data:
                    # Check if data.data is a dict with location fields or if it has a nested 'result' field
                    location_data = data["data"]
                    
                    # If location_data has a 'result' field, use that instead
                    if isinstance(location_data, dict) and "result" in location_data:
                        location_data = location_data["result"]
                    
                    # Basic information
                    name = location_data.get("name", "Unknown")
                    formatted_response += f"Name: {name}\n"
                    internal_name = location_data.get("internalName", "Unknown")
                    formatted_response += f"Internal Name: {internal_name}\n"
                    
                    # Address information
                    address_line1 = location_data.get("addressLine1", "")
                    address_line2 = location_data.get("addressLine2", "")
                    city = location_data.get("city", "")
                    postal_code = location_data.get("postalCode", "")
                    country_code = location_data.get("countryCode", "")
                    
                    address_parts = []
                    if address_line1:
                        address_parts.append(address_line1)
                    if address_line2 and address_line2 != "null":
                        address_parts.append(address_line2)
                    if city:
                        address_parts.append(city)
                    if postal_code:
                        address_parts.append(postal_code)
                    if country_code:
                        address_parts.append(country_code)
                    
                    address_str = ", ".join(filter(None, address_parts))
                    formatted_response += f"Address: {address_str}\n"
                    
                    # Contact information
                    formatted_response += f"Phone: {location_data.get('telephone', 'N/A')}\n"
                    formatted_response += f"Email: {location_data.get('businessEmail', 'N/A')}\n"
                    formatted_response += f"Website: {location_data.get('website', 'N/A')}\n\n"
                    
                    # Status and dates
                    formatted_response += f"Status: {location_data.get('status', 'N/A')}\n"
                    formatted_response += f"Created: {location_data.get('createdAt', 'N/A')}\n"
                    formatted_response += f"Updated: {location_data.get('updatedAt', 'N/A')}\n\n"
                    
                    # Category information
                    formatted_response += f"Category: {location_data.get('category', 'N/A')}\n"
                    formatted_response += f"Google Category: {location_data.get('googleCategory', 'N/A')}\n\n"
                    
                    # Additional details
                    formatted_response += f"Reporting Enabled: {location_data.get('reportingEnabled', 'N/A')}\n"
                    formatted_response += f"SoConnect Status: {location_data.get('soconnect_connectivity_status', 'N/A')}\n"
                    
                    # Company information if available
                    company = location_data.get('company', {})
                    if isinstance(company, dict) and company.get('name'):
                        formatted_response += f"Company: {company.get('name', 'N/A')}\n\n"
                    
                    # Add debug information about the data structure
                    formatted_response += "===DATA STRUCTURE===\n"
                    if "result" in data.get("data", {}):
                        formatted_response += "Response contains nested 'result' object\n\n"
                    else:
                        formatted_response += "Response contains direct location data\n\n"
                    
                    # Include full JSON response for reference (truncated for readability)
                    formatted_response += f"===FULL RESPONSE (TRUNCATED)===\n{json.dumps(data, indent=2)[:1000]}...\n"
                else:
                    formatted_response += "No data found in response.\n"
                
                return [types.TextContent(type="text", text=formatted_response)]
                
            else:
                # Include full error response
                error_msg = f"❌ Failed to fetch location details: HTTP {response.status_code}\n{response.text}"
                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 location details: {str(e)}\n\nURL: {url}\n\n{error_trace}"
            )]
  • Registration of the "get_location_details" tool in the server's list_tools function.
    types.Tool(
        name="get_location_details",
        description="Get detailed information about a specific location by ID",
        inputSchema={
            "type": "object",
            "properties": {
                "location_id": {"type": "string", "description": "ID of the location to get details for"},
                "access_token": {"type": "string", "description": "Access token for Obenan API. Optional if OBENAN_LOGIN_ACCESS_TOKEN environment variable is set."}
            },
            "required": ["location_id"]
        },
    ),
Behavior2/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 but fails to address idempotency, error handling (e.g., 404 for invalid IDs), what constitutes 'detailed information,' or specific auth requirements beyond the parameter name.

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 a single, front-loaded sentence with no redundancy. However, it is arguably underspecified given the lack of annotations and output schema, though structurally it is efficient.

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?

Without an output schema, the description should clarify what 'detailed information' includes (e.g., address, hours, coordinates) or behavioral traits. It also lacks differentiation from siblings and auth context, leaving operational gaps.

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 description coverage is 100%, with both location_id and access_token fully documented in the schema. The description adds no additional parameter semantics, but given the high schema coverage, the baseline score of 3 is appropriate.

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 verb ('Get'), resource ('detailed information about a specific location'), and scope ('by ID'). The 'by ID' phrasing implicitly distinguishes it from sibling search_locations_by_name and fetch_my_locations, though it does not explicitly name these alternatives.

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 siblings like search_locations_by_name (when the ID is unknown) or fetch_my_locations (for bulk retrieval). No prerequisites or exclusions are mentioned.

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