Skip to main content
Glama
CodeDreamer06

Unstop MCP Server

search_hackathons_by_location

Find offline Unstop hackathons near a specific city, address, or campus by setting a search radius and applying filters for payment, team size, and user type.

Instructions

Find offline Unstop hackathons within a radius of a city, address, or campus.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationYes
radius_kmNo
regionNo
paymentNo
teamsizeNo
usertypeNo
searchNo
sortNo
directionNo
pageNo
per_pageNo

Implementation Reference

  • The business logic implementation of the search_hackathons_by_location tool in the service layer.
    def search_hackathons_by_location(self, query: SearchByLocationInput) -> LocationSearchResponse:
        if not self.geocoder:
            raise UnstopValidationError(
                "Location search requires geopy. Install optional geocoding support before using this tool."
            )
    
        coordinates = self.geocode_input(query.location)
        if coordinates is None:
            raise UnstopValidationError(
                f"Could not geocode location '{query.location}'. Try a more specific city or address."
            )
    
        self.ensure_cache()
        filtered = self.filter_cached(
            region=query.region,
            payment=query.payment,
            teamsize=query.teamsize,
            usertype=query.usertype,
            search=query.search,
        )
    
        results: list[dict[str, Any]] = []
        for hackathon in filtered:
            if hackathon.get("region") == "online" and query.region != "online":
                continue
    
            lat = hackathon.get("_lat")
            lng = hackathon.get("_lng")
            if lat is None or lng is None:
                continue
    
            distance = haversine(coordinates[0], coordinates[1], lat, lng)
            if distance <= query.radius_km:
                enriched = dict(hackathon)
                enriched["distance_km"] = round(distance, 1)
                results.append(enriched)
    
        if query.sort in (None, "distance"):
            reverse = query.direction == "desc"
  • The MCP tool registration and request handler in server.py which calls the service.
        name="search_hackathons_by_location",
        description="Find offline Unstop hackathons within a radius of a city, address, or campus.",
    )
    def search_hackathons_by_location(
        location: str,
        radius_km: float = 300.0,
        region: str | None = None,
        payment: str | None = None,
        teamsize: int | None = None,
        usertype: str | None = None,
        search: str | None = None,
        sort: str | None = None,
        direction: str | None = None,
        page: int = 1,
        per_page: int = 18,
    ) -> dict:
        try:
            query = SearchByLocationInput(
                location=location,
                radius_km=radius_km,
                region=region,
                payment=payment,
                teamsize=teamsize,
                usertype=usertype,
                search=search,
                sort=sort,
                direction=direction,
                page=page,
                per_page=per_page,
            )
            return service.search_hackathons_by_location(query).model_dump(mode="json")
        except (UnstopValidationError, UnstopAPIError, ValueError) as exc:
            raise ValueError(str(exc)) from exc
  • Input validation schema for the search_hackathons_by_location tool.
    class SearchByLocationInput(BaseModel):
        location: str = Field(min_length=1)
        radius_km: float = Field(default=300.0, gt=0)
        region: Literal["online", "offline"] | None = None
        payment: Literal["paid", "unpaid"] | None = None
        teamsize: Literal[1, 2, 3] | None = None
        usertype: Literal["college_students", "fresher", "professionals", "school_students"] | None = None
        search: str | None = None
        sort: Literal["prize", "days_left", "distance"] | None = None
        direction: Literal["asc", "desc"] | None = None
        page: int = Field(default=1, ge=1)
        per_page: int = Field(default=DEFAULT_PER_PAGE, ge=1, le=MAX_PER_PAGE)
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 mentions the tool finds 'offline' hackathons, which is useful context, but doesn't address critical behavioral aspects like whether this is a read-only operation, what happens with invalid locations, rate limits, authentication requirements, or pagination behavior (despite having page/per_page parameters).

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

Conciseness5/5

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

The description is a single, efficient sentence that conveys the core functionality without unnecessary words. It's appropriately sized and front-loaded with the essential information about what the tool does.

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?

For a tool with 11 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain the purpose of most parameters, doesn't describe the return format, and provides minimal behavioral context. The agent would struggle to use this tool effectively without additional information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions 'radius' and 'city, address, or campus' which partially explains the 'location' and 'radius_km' parameters. However, with 11 total parameters and 0% schema description coverage, the description fails to explain the purpose of the other 9 parameters (region, payment, teamsize, usertype, search, sort, direction, page, per_page), leaving most parameters undocumented.

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: 'Find offline Unstop hackathons within a radius of a city, address, or campus.' It specifies the verb ('Find'), resource ('offline Unstop hackathons'), and scope ('within a radius'). However, it doesn't explicitly differentiate from the sibling 'search_hackathons' tool, which appears to be a more general search function.

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 minimal usage guidance. It implies this tool should be used for location-based searches ('within a radius of a city, address, or campus'), but offers no explicit comparison to the sibling 'search_hackathons' tool, no guidance on when not to use it, and no mention of prerequisites or alternatives.

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/CodeDreamer06/UnstopMCP'

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