Skip to main content
Glama

getPublicPrice

Read-onlyIdempotent

Retrieve cached public hotel prices for a specific stay and occupancy, so you can compare negotiated rates, validate offers, and assess market pricing. Requires hotel ID, check-in/out, and adults.

Instructions

Overview

Retrieve cached public price data for a specific hotel and occupancy. This endpoint returns pricing information sourced from public booking platforms (e.g., Booking.com, Expedia) that has been pre-fetched and cached. It applies occupancy canonicalization automatically, so callers don't need to replicate that logic.

⚠️ Beta Feature: This endpoint is currently in beta. The API structure and behavior may change in future versions.

Rate Limiting: This endpoint is rate-limited to 10 requests per minute for both sandbox and production API keys. Exceeding this limit will result in a 429 Too Many Requests response.

When to Use

  • Price comparison - Compare your negotiated rates against publicly available prices

  • Rate validation - Verify that your offered rates are competitive before displaying to end users

  • Market intelligence - Understand public pricing trends for specific hotels and dates

What You Get

  • amount - The best (lowest) cached public price for the stay in the specified currency

  • nightlyAmount - The best (lowest) nightly public price

  • currency - Currency code (USD)

  • provider - Normalized provider identifier for the best offer (e.g., cheaptickets)

  • rawObservedText - Raw observed price text from the source

  • offers - Public price offers from multiple booking providers

  • fetchedAt - When the price was last retrieved from the source

  • expiresAt - When this cached price expires and should no longer be used

Key Features

  • Occupancy-specific - Prices are stored per occupancy configuration; query params must match write-time occupancy

  • Negative cache aware - Returns 404 for both cache misses and negative cache entries (hotels with no public price found)

  • Low latency - Direct cache lookup, no upstream API calls

Parameters

  • hotelId (required): The liteAPI hotel ID (e.g., lpec902)

  • checkin (required): Check-in date in YYYY-MM-DD format

  • checkout (required): Check-out date in YYYY-MM-DD format

  • adults (required): Number of adult guests

  • childrenAges (optional): Comma-separated ages of children (e.g., 5,8)

  • currency (optional): Currency code; if present, must be USD

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
adultsYesNumber of adult guests
checkinYesCheck-in date in YYYY-MM-DD format
hotelIdYesThe liteAPI hotel ID
checkoutYesCheck-out date in YYYY-MM-DD format
currencyNoCurrency code. If present, must be USD.
childrenAgesNoComma-separated ages of children (e.g., '5,8'). Occupancy params must match those used at write time.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive), and the description still adds substantial behavior: a 10 req/min rate limit with a 429 outcome, beta status with possible API changes, 404 for both cache misses and negative-cache entries, automatic occupancy canonicalization, and a no-upstream-call low-latency guarantee. This is exactly the extra context annotations cannot express.

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?

Well front-loaded with headers, and the warning/rate-limit callouts are appropriately prominent. It is long and the 'Parameters' section largely restates the schema, which is the only redundancy; overall each block earns its place.

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?

With no output schema, the 'What You Get' block documents the return fields (amount, nightlyAmount, provider, fetchedAt, expiresAt, offers), so the agent knows both what it receives and when the data expires. Combined with the rate-limit, beta, and 404 semantics, nothing needed to invoke this correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema: a concrete hotelId example (`lpec902`), the constraint that query params must match write-time occupancy, the `5,8` childrenAges form, and the USD-only currency restriction. These are operational constraints not present in 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 states a specific verb and resource ('Retrieve cached public price data for a specific hotel and occupancy') and scopes it to pre-fetched public booking-platform data. This distinguishes it from live-rate siblings such as post_hotels_rates and post_rates_prebook without the agent opening a schema.

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

Usage Guidelines4/5

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

It provides three concrete use cases (price comparison, rate validation, market intelligence) that clearly frame when this tool applies. However, it never names an alternative tool or an explicit when-not-to-use condition, so routing against siblings like post_hotels_min_rates is still left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools