Skip to main content
Glama
remuzel

Polarsteps MCP Server

by remuzel

get_trip_log

Retrieve a summarized overview of a specific Polarsteps trip with timestamped steps, titles, descriptions, and locations to understand travel activities before accessing detailed information.

Instructions

Get an overview of the specific trip; this includes just a list of summarized steps, each including timestamp/title/description/location. Use this first for trip overviews before diving into detailed information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trip_idYesThe unique numerical identifier of a Polarsteps trip (typically 7+ digits)

Implementation Reference

  • The core handler function implementing the get_trip_log tool. It retrieves the trip using _get_trip, checks for validity and steps, constructs a log of steps as JSON-serializable dicts with timestamp, title, description, location, and returns them as TextContent.
    def get_trip_log(
        polarsteps_client: PolarstepsClient, input: GetTripLogInput
    ) -> list[TextContent]:
        trip = _get_trip(polarsteps_client, input.trip_id)
        if trip.id == -1:
            return single_text_content(f"Could not find trip with ID: {input.trip_id}")
        if trip.all_steps is None:
            return single_text_content(
                f"Trip with ID {input.trip_id} does not have any logged steps"
            )
    
        trip_log = [
            {
                "timestamp": step.timestamp,
                "title": step.name,
                "description": step.description,
                "location": f"{step.location.name} ({step.location.country_code})"
                if step.location
                else "Unknown",
            }
            for step in trip.all_steps
            if step.name is not None
        ]
        return [TextContent(type="text", text=json.dumps(trip)) for trip in trip_log]
  • Pydantic input schema for the get_trip_log tool, defining the required trip_id parameter with validation (integer >= 1,000,000).
    class GetTripLogInput(BaseModel):
        trip_id: int = Field(
            ...,
            description="The unique numerical identifier of a Polarsteps trip (typically 7+ digits)",
            ge=1_000_000,
        )
  • Tool registration within the PolarstepsTool enum, associating the name 'get_trip_log', its description, and input schema for MCP tool listing.
    TRIP_LOG = (
        "get_trip_log",
        "Get an overview of the specific trip; this includes just a list of summarized steps, each including timestamp/title/description/location. Use this first for trip overviews before diving into detailed information.",
        GetTripLogInput,
    )
  • MCP server tool dispatch/registration in call_tool handler, matching on TRIP_LOG enum and invoking the get_trip_log function with parsed input.
    case PolarstepsTool.TRIP_LOG:
        input = GetTripLogInput(**args)
        return get_trip_log(client, input)

Tool Definition Quality

Score is being calculated. Check back soon.

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

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