Skip to main content
Glama

search_activities

Read-onlyIdempotent

Find tours, attractions, and experiences in any city for your travel dates. Filter by category to plan day activities or fill your itinerary.

Instructions

Search tours, experiences, attractions, sightseeing, and things to do via Viator (200K+ activities worldwide). Filter by city, date range, and category (food tours, walking tours, museums, snorkeling, sailing, hiking, sunset cruises, cooking classes, day trips, etc.). Returns activities with photos, ratings, durations, and per-person pricing. Use this when the user wants to plan day activities, find tours, book experiences, fill a trip itinerary, or pick attractions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityYesCity name (e.g., 'New York', 'Tokyo', 'Paris')
date_fromYesStart date (YYYY-MM-DD)
date_toNoOptional end date (YYYY-MM-DD). Defaults to date_from for single-day searches.
categoryNoOptional category filter (e.g., 'food', 'culture', 'adventure', 'nightlife', 'wellness')

Implementation Reference

  • The main handler for the 'search_activities' tool. It destructures args (city, date_from, date_to, category), builds a query string, calls the API at POST /v1/activities/search with query params, then trims the response using trimActivityResponse helper.
    case "search_activities": {
      const { city, date_from, date_to, category } = args as {
        city: string; date_from: string; date_to?: string; category?: string;
      };
      const qs = new URLSearchParams();
      qs.set("city", city);
      qs.set("date_from", date_from);
      if (date_to) qs.set("date_to", date_to);
      if (category) qs.set("category", category);
      const result = await apiCall("POST", `/v1/activities/search?${qs.toString()}`);
      const trimmed = trimActivityResponse(result);
      return { content: [{ type: "text", text: JSON.stringify(trimmed, null, 2) }] };
    }
  • Input schema definition for the 'search_activities' tool. Defines properties: city (string, required), date_from (string, required), date_to (optional string), category (optional string).
    {
      name: "search_activities",
      description:
        "Search tours, experiences, attractions, sightseeing, and things to do via Viator (200K+ activities worldwide). Filter by city, date range, and category (food tours, walking tours, museums, snorkeling, sailing, hiking, sunset cruises, cooking classes, day trips, etc.). Returns activities with photos, ratings, durations, and per-person pricing. Use this when the user wants to plan day activities, find tours, book experiences, fill a trip itinerary, or pick attractions.",
      inputSchema: {
        type: "object" as const,
        properties: {
          city: { type: "string", description: "City name (e.g., 'New York', 'Tokyo', 'Paris')" },
          date_from: { type: "string", description: "Start date (YYYY-MM-DD)" },
          date_to: { type: "string", description: "Optional end date (YYYY-MM-DD). Defaults to date_from for single-day searches." },
          category: { type: "string", description: "Optional category filter (e.g., 'food', 'culture', 'adventure', 'nightlife', 'wellness')" },
        },
        required: ["city", "date_from"],
      },
    },
  • src/server.ts:272-285 (registration)
    The tool is registered in the ALL_TOOLS array with name 'search_activities', its description (searching tours/experiences via Viator), and the inputSchema. This array is exposed via ListToolsRequestSchema handler.
    {
      name: "search_activities",
      description:
        "Search tours, experiences, attractions, sightseeing, and things to do via Viator (200K+ activities worldwide). Filter by city, date range, and category (food tours, walking tours, museums, snorkeling, sailing, hiking, sunset cruises, cooking classes, day trips, etc.). Returns activities with photos, ratings, durations, and per-person pricing. Use this when the user wants to plan day activities, find tours, book experiences, fill a trip itinerary, or pick attractions.",
      inputSchema: {
        type: "object" as const,
        properties: {
          city: { type: "string", description: "City name (e.g., 'New York', 'Tokyo', 'Paris')" },
          date_from: { type: "string", description: "Start date (YYYY-MM-DD)" },
          date_to: { type: "string", description: "Optional end date (YYYY-MM-DD). Defaults to date_from for single-day searches." },
          category: { type: "string", description: "Optional category filter (e.g., 'food', 'culture', 'adventure', 'nightlife', 'wellness')" },
        },
        required: ["city", "date_from"],
      },
  • The trimActivityResponse helper function that processes the raw API response for activities. Slices data to limit (default 20), maps each activity to a compact object with product_id, name, category, duration, price_usd, rating, reviews_count, thumbnail, and description.
    function trimActivityResponse(raw: any, limit = 20): any {
      const data = Array.isArray(raw?.data) ? raw.data : [];
      const trimmed = data.slice(0, limit).map((a: any) => ({
        product_id: a.product_id || a.id,
        name: a.name || a.title,
        category: a.category,
        duration: a.duration || (a.duration_hours ? `${a.duration_hours}h` : null),
        price_usd: a.price_usd || a.price,
        rating: a.rating,
        reviews_count: a.reviews_count || 0,
        thumbnail: a.thumbnail || (a.photos?.[0]?.url) || (typeof a.photos?.[0] === "string" ? a.photos[0] : null),
        description: (a.description || "").replace(/<[^>]*>/g, "").slice(0, 320),
      }));
      return {
        data: trimmed,
        meta: { count: trimmed.length, total_returned: data.length, trimmed_for_llm: data.length > limit },
      };
    }
  • src/server.ts:509-510 (registration)
    Annotation registration for search_activities in TOOL_ANNOTATIONS: title 'Search Activities & Experiences', with readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=true.
    search_activities: { title: "Search Activities & Experiences", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
    search_events: { title: "Search Live Events & Tickets", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
Behavior4/5

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

Annotations already declare readOnly, idempotent, and non-destructive. Description adds that results include photos, ratings, durations, and pricing—valuable context beyond the structured fields.

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

Conciseness5/5

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

Two sentences with no filler. First sentence states purpose and scope; second sentence tells when to use. Information-dense and front-loaded.

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 rich annotations covering safety and no required output schema, the description covers all essential aspects: purpose, scope, filters, typical use cases, and result contents. No gaps.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents all four parameters. The description summarizes filters and provides example categories (e.g., 'food tours', 'walking tours'), adding marginal value but not new meaning.

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 specifies a precise verb ('Search') and resource ('tours, experiences, attractions... via Viator with 200K+ activities'). It clearly distinguishes from sibling tools like search_dining or search_flights by focusing on activities and experiences.

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?

Explicitly states 'Use this when the user wants to plan day activities... fill a trip itinerary' and lists filterable dimensions. Lacks explicit when-not-to-use instructions, but sibling context makes that clear.

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/Autonomad1/autonomad-travel'

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