Skip to main content
Glama
nanwer
by nanwer

search_cheapest_dates

Find cheapest travel dates within a flexible date range by comparing prices for departures and returns. Results sorted by total cost.

Instructions

🎯 RENDERING DIRECTIVE — READ FIRST. When this tool returns 5+ entries, render them as an HTML/React artifact — a small price-grid or chart, NOT a long flowing list. For 1-4 entries, prose is fine. The cheapest 1-2 dates should be visually highlighted. Offer to deep-dive into the cheapest date with search_flights once the user picks one.

Find which travel dates are cheapest across a flexible range, using Google Flights data.

Returns a list of (departure_date, return_date, price) entries sorted cheapest first. Does not return flight times, airlines, or layover details — for that, use search_flights once the user picks a date.

USE THIS TOOL WHEN: the user is flexible on travel dates and wants to know which dates within a range are cheapest. Typical phrasings: "any week in May", "next month sometime", "around the second week of June", "is it cheaper if I shift my trip a few days?".

USE search_flights INSTEAD WHEN: the user has specific dates and wants flight details, airlines, departure times, layovers, and bookable offers.

The currency Google Flights returns is determined by the request region and is surfaced in each entry's currency field; do not assume USD.

For round-trip date searches, trip_duration (in days) is required — it determines each candidate return date. The tool returns a (departure_date, departure_date + trip_duration) pair per result. For one-way, return_date in each result is null.

Filter parameters mirror search_flights:

  • max_stops: one of ANY (default), NON_STOP, ONE_STOP_OR_FEWER, TWO_OR_FEWER_STOPS. "Or fewer" semantics.

  • departure_window: a "HH-HH" string in 24-hour local time, applied to the outbound departure. Hours are inclusive of the start and EXCLUSIVE of the end — "8-20" matches 08:00 through 19:59 local time.

  • airlines: an optional list of IATA airline codes. Shows date entries where AT LEAST ONE of the listed airlines operates ANY segment. For example, ["FI"] returns dates with options operated entirely or partly by Icelandair; it does NOT restrict to Icelandair-only itineraries. Omit or pass null for no airline filter.

PRE-CALL ELICITATION: Before calling this tool, ensure the user has expressed:

  • Date range: a clear earliest acceptable departure (start_date) and latest acceptable departure (end_date). If they said "next month" or "sometime in May" without bounds, ask. The wider the range, the slower and noisier the result.

  • Trip duration (round-trip only): the number of nights/days they want to be away. "About 10 days" needs to become a concrete trip_duration integer.

  • What flexibility actually means to the user: are they only flexible on departure date, or also on trip length? If trip length is flexible, run this tool multiple times with different trip_duration values; this tool only varies departure within one duration.

RESULT PRESENTATION: Render the results as a sorted list with the cheapest entries highlighted, or a small date grid if the range is short. Each entry shows the departure date, the return date (if round-trip), and the total price with currency. Lead with the cheapest. Offer to deep-dive into a specific date with search_flights once the user picks one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
originYes
airlinesNo
end_dateYes
max_stopsNoANY
passengersNo
start_dateYes
cabin_classNoECONOMY
destinationYes
is_round_tripNo
trip_durationNo
departure_windowNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses result format (sorted list of date combinations and price), what is not returned (flight details), parameter semantics (e.g., departure_window exclusivity, airline filter behavior), currency behavior, and performance implications. It does not explicitly state the tool is read-only, but the context implies it, and the level of detail is high.

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

Conciseness4/5

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

The description is well-structured with section headers and bullet points, front-loading the purpose. However, it is somewhat verbose, particularly the rendering directive and pre-call elicitation sections, which could be condensed without losing essential guidance. Nonetheless, every part serves a clear purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (11 parameters, output schema present), the description is complete. It covers purpose, usage, parameter details, output format (list of entries with date and price), rendering guidance, and follow-up actions. The presence of an output schema reduces the burden, but the description still explains the output structure adequately.

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

Parameters5/5

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

The input schema provides only types and defaults with 0% description coverage. The description compensates thoroughly by explaining every parameter's meaning, format, and behavior, including edge cases like trip_duration requirement for round trips, departure_window exclusivity, airlines filter semantics, and default values. This adds significant value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/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 which travel dates are cheapest across a flexible range' and distinguishes it from the sibling tool 'search_flights' by explicitly stating what it does not return and providing usage scenarios. The verb 'find' and resource 'cheapest travel dates' are specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes explicit sections 'USE THIS TOOL WHEN' and 'USE search_flights INSTEAD WHEN' with typical user phrasings, and provides a 'PRE-CALL ELICITATION' section detailing required user inputs. This offers comprehensive guidance on when to invoke this tool versus 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/nanwer/trip-search-mcp'

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