Skip to main content
Glama
remuzel

Polarsteps MCP Server

by remuzel

search_trips

Find specific trips in a user's travel history by searching with destination names, themes, or partial trip titles using flexible matching that accommodates approximate spelling.

Instructions

Search through a user's trips by name/title using fuzzy matching to find specific trips. Ideal for finding trips by destination (e.g., 'japan', 'italy'), themes (e.g., 'honeymoon', 'business'), or partial name matches. Supports flexible search terms that don't need to match exactly - the fuzzy matching will find relevant trips even with approximate spelling or partial keywords. Use this as the first step when looking for specific trips by destination, theme, or name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesThe Polarsteps username whose trips you want to search through
name_queryYesSearch term to match against trip names/titles (supports partial matching and fuzzy search)

Implementation Reference

  • The main handler function that performs fuzzy search on user's trips by name or summary matching the query.
    def search_trips(polarsteps_client: PolarstepsClient, input: SearchTripsInput): user = _get_user(polarsteps_client, input.username) if user.alltrips is None: return single_text_content( f"No trips found for user with username={input.username}" ) matched_trips = fuzzy_search_items( user.alltrips, input.name_query, field_name="name" ) matched_trips.extend( fuzzy_search_items(user.alltrips, input.name_query, field_name="summary") ) return [ TextContent(type="text", text=trip.model_dump_json(include={"id", "name"}, exclude_none=True)) for trip, _ in matched_trips ]
  • Pydantic model defining the input schema for the search_trips tool: username and name_query.
    class SearchTripsInput(BaseModel): username: str = Field( ..., description="The Polarsteps username whose trips you want to search through", ) name_query: str = Field( ..., description="Search term to match against trip names/titles (supports partial matching and fuzzy search)", )
  • Tool registration in PolarstepsTool enum: name, description, and schema reference.
    SEARCH_TRIPS = ( "search_trips", "Search through a user's trips by name/title using fuzzy matching to find specific trips. Ideal for finding trips by destination (e.g., 'japan', 'italy'), themes (e.g., 'honeymoon', 'business'), or partial name matches. Supports flexible search terms that don't need to match exactly - the fuzzy matching will find relevant trips even with approximate spelling or partial keywords. **Use this as the first step when looking for specific trips by destination, theme, or name.**", SearchTripsInput, )
  • Dispatch case in MCP server's call_tool handler that invokes the search_trips function.
    case PolarstepsTool.SEARCH_TRIPS: input = SearchTripsInput(**args) return search_trips(client, input)
  • MCP server tool listing function that registers all PolarstepsTool entries, including search_trips.
    @server.list_tools() async def list_tools() -> list[Tool]: return [ Tool( name=tool.value, description=tool.description, inputSchema=tool.schema, ) for tool in PolarstepsTool ]

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/remuzel/polarsteps-mcp'

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