Skip to main content
Glama

get_locations

Retrieve detailed location data for a business, including address, coordinates, and URLs, using the business ID for DevHub CMS integration.

Instructions

Get all locations for a business

Returns a list of locations with the following fields: - id: Location ID that can be used in the other tools - location_name: Location name - location_url: Location URL in DevHub - street: Street address - city: City - state: State - country: Country - postal_code: Postal code - lat: Latitude - lon: Longitude

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
business_idYes

Implementation Reference

  • The main handler function for the 'get_locations' MCP tool. It is decorated with @mcp.tool() which registers it as a tool with the name 'get_locations'. Fetches and formats locations for the given business_id from the DevHub API.
    @mcp.tool() def get_locations(business_id: int) -> list: """Get all locations for a business Returns a list of locations with the following fields: - id: Location ID that can be used in the other tools - location_name: Location name - location_url: Location URL in DevHub - street: Street address - city: City - state: State - country: Country - postal_code: Postal code - lat: Latitude - lon: Longitude """ client, base_url = get_client() params = { 'business_id': business_id, 'limit': 600, 'order_by': 'location_name', } r = client.get('{}locations/'.format(base_url), params=params) content = json.loads(r.content) return [{ 'id': location['id'], 'location_name': location['location_name'], 'location_url': location['location_url'], 'street': location['street'], 'city': location['city'], 'state': location['state'], 'country': location['country'], 'postal_code': location['postal_code'], 'lat': location['lat'], 'lon': location['lon'], } for location in content['objects']]

Other Tools

Related 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/devhub/devhub-cms-mcp'

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