Skip to main content
Glama
remuzel

Polarsteps MCP Server

by remuzel

get_trips

Fetch recent trips from a Polarsteps user's travel history with summary details like names, dates, duration, and basic statistics. Control the number of trips retrieved to browse travel history or find trip IDs for further exploration.

Instructions

Fetch a list of a user's recent trips with summary information including trip names, dates, duration, and basic stats. Ideal for browsing someone's travel history or finding trip IDs for detailed exploration. Use n_trips parameter to control how many recent trips to retrieve (default: 5).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesThe Polarsteps username whose trips you want to retrieve
n_tripsNoMaximum number of recent trips to return (ordered by most recent first)

Implementation Reference

  • The core handler function for the 'get_trips' tool. Retrieves the user's trips via _get_user helper, checks if trips exist, and returns JSON-serialized summaries of the most recent n_trips (default 5) as TextContent objects.
    def get_trips( polarsteps_client: PolarstepsClient, input: GetTripsInput ) -> list[TextContent]: 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}" ) return [ TextContent(type="text", text=json.dumps(trip.to_summary())) for trip in user.alltrips[: input.n_trips] ]
  • Pydantic model defining the input schema for the get_trips tool, with required 'username' and optional 'n_trips' (default 5, min 1) fields.
    class GetTripsInput(BaseModel): username: str = Field( ..., description="The Polarsteps username whose trips you want to retrieve" ) n_trips: int = Field( 5, ge=1, description="Maximum number of recent trips to return (ordered by most recent first)", )
  • Registration of the 'get_trips' tool in the PolarstepsTool Enum, providing the tool name, description, and input schema for MCP server tool listing.
    TRIPS = ( "get_trips", "Fetch a list of a user's recent trips with summary information including trip names, dates, duration, and basic stats. Ideal for browsing someone's travel history or finding trip IDs for detailed exploration. Use n_trips parameter to control how many recent trips to retrieve (default: 5).", GetTripsInput, )
  • Dispatch logic in the MCP server's call_tool handler that invokes the get_trips function with parsed input when the 'get_trips' tool is called.
    case PolarstepsTool.TRIPS: input = GetTripsInput(**args) return get_trips(client, input)

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