Skip to main content
Glama
devhub

DevHub CMS MCP

Official
by devhub

get_nearest_location

Find the closest DevHub CMS location by providing business ID and coordinates to identify nearby facilities.

Instructions

Get the nearest DevHub location

Args:
    business_id: DevHub Business ID associated with the location. Prompt the user for this ID
    latitude: Latitude of the location
    longitude: Longitude of the location

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
business_idYes
latitudeYes
longitudeYes

Implementation Reference

  • The main handler function for the 'get_nearest_location' tool. It is decorated with @mcp.tool() which also serves as registration and defines the schema via type hints and docstring. Fetches the nearest location from DevHub API using provided coordinates and business ID.
    @mcp.tool()
    def get_nearest_location(business_id: int, latitude: float, longitude: float) -> str:
        """Get the nearest DevHub location
    
        Args:
            business_id: DevHub Business ID associated with the location. Prompt the user for this ID
            latitude: Latitude of the location
            longitude: Longitude of the location
        """
        client, base_url = get_client()
        r = client.get('{}locations/'.format(base_url), params={
            'business_id': business_id,
            'near_lat': latitude,
            'near_lon': longitude,
        })
        objects = json.loads(r.content)['objects']
        if objects:
            return f"""
    Location ID: {objects[0]['id']}
    Location name: {objects[0]['location_name']}
    Location url: {objects[0]['location_url']}
    Street: {objects[0]['street']}
    City: {objects[0]['city']}
    State: {objects[0]['state']}
    Country: {objects[0]['country']}
    """
  • Helper function get_client() used by get_nearest_location to obtain the OAuth client and base URL for API calls.
    def get_client():
        """Get DevHub API client and base_url."""
        client = OAuth1Session(
            os.environ['DEVHUB_API_KEY'],
            client_secret=os.environ['DEVHUB_API_SECRET'])
        base_url = '{}/api/v2/'.format(os.environ['DEVHUB_BASE_URL'])
        return client, base_url
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. It states it 'Get's data, implying a read-only operation, but doesn't cover critical aspects like authentication needs, rate limits, error handling, or what the return format looks like (e.g., distance, address details). This is a significant gap for a tool with zero annotation coverage.

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 sized and front-loaded, with the core purpose stated first followed by parameter details. The parameter explanations are efficient, though the formatting with 'Args:' could be slightly more polished for readability.

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 complexity (3 required parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what the tool returns (e.g., nearest location details, distance metrics), error conditions, or behavioral traits like performance or dependencies, leaving the agent with insufficient context for reliable invocation.

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 description adds meaningful context beyond the input schema, which has 0% description coverage. It explains that 'business_id' is a 'DevHub Business ID associated with the location' and instructs to 'Prompt the user for this ID', and clarifies that 'latitude' and 'longitude' refer to 'the location' (presumably the user's or a target location). This compensates well for the lack of schema descriptions.

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' and resource 'nearest DevHub location', making the purpose specific and understandable. However, it doesn't differentiate from sibling tools like 'get_locations' or 'get_businesses', which might have overlapping functionality for location-related queries.

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 is provided on when to use this tool versus alternatives like 'get_locations' or 'get_businesses'. The description lacks context about prerequisites, exclusions, or specific use cases, leaving the agent with no directional cues for tool selection.

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

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