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
| Name | Required | Description | Default |
|---|---|---|---|
| trip_id | Yes | The unique numerical identifier of a Polarsteps trip (typically 7+ digits) |
Implementation Reference
- src/polarsteps_mcp/tools.py:102-125 (handler)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]
- src/polarsteps_mcp/tools.py:94-100 (schema)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, )
- src/polarsteps_mcp/tools.py:222-226 (registration)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, )
- src/polarsteps_mcp/server.py:60-62 (registration)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)