Skip to main content
Glama

request_booking

Submit a pet sitting booking request to a Rover sitter by specifying service type, dates, and pet details. Requires user authentication to proceed.

Instructions

Send a booking request to a sitter. Requires being logged in.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sitterIdYesSitter's Rover username/ID or profile URL
serviceTypeYesType of service to book
startDateYesStart date in YYYY-MM-DD format
endDateYesEnd date in YYYY-MM-DD format
petIdsYesList of pet IDs to include in the booking
messageNoOptional introductory message to the sitter

Implementation Reference

  • The main implementation of the requestBooking method that executes the booking logic. It checks login status, navigates to the sitter's profile, fills in booking details (dates, message), and returns success/failure status.
    async requestBooking(request: BookingRequest): Promise<{ success: boolean; bookingId?: string; message: string }> {
      if (!this.session.isLoggedIn) {
        return { success: false, message: "You must be logged in to request a booking." };
      }
      const page = this.ensurePage();
      const sitterUrl = request.sitterId.startsWith("http")
        ? request.sitterId
        : `${this.BASE_URL}/sitters/${request.sitterId}/`;
    
      await page.goto(sitterUrl);
      await page.waitForLoadState("networkidle");
    
      const requestBtn = page.locator(
        'button:has-text("Request"), a:has-text("Book"), button:has-text("Book")'
      ).first();
      if (await requestBtn.isVisible()) {
        await requestBtn.click();
        await page.waitForLoadState("networkidle");
      }
    
      const startInput = page.locator('input[name*="start"], input[placeholder*="start"]').first();
      if (await startInput.isVisible()) {
        await startInput.fill(request.startDate);
      }
      const endInput = page.locator('input[name*="end"], input[placeholder*="end"]').first();
      if (await endInput.isVisible()) {
        await endInput.fill(request.endDate);
      }
    
      if (request.message) {
        const msgInput = page.locator('textarea[name*="message"], textarea[placeholder*="message"]').first();
        if (await msgInput.isVisible()) {
          await msgInput.fill(request.message);
        }
      }
    
      return {
        success: true,
        message: "Booking request initiated. Please complete on Rover.com.",
      };
    }
  • src/index.ts:104-140 (registration)
    Tool registration defining the 'request_booking' tool with its JSON schema, including sitterId, serviceType, startDate, endDate, petIds, and optional message parameters.
    {
      name: "request_booking",
      description:
        "Send a booking request to a sitter. Requires being logged in.",
      inputSchema: {
        type: "object",
        properties: {
          sitterId: {
            type: "string",
            description: "Sitter's Rover username/ID or profile URL",
          },
          serviceType: {
            type: "string",
            enum: ["boarding", "house_sitting", "drop_in", "doggy_day_care", "dog_walking"],
            description: "Type of service to book",
          },
          startDate: {
            type: "string",
            description: "Start date in YYYY-MM-DD format",
          },
          endDate: {
            type: "string",
            description: "End date in YYYY-MM-DD format",
          },
          petIds: {
            type: "array",
            items: { type: "string" },
            description: "List of pet IDs to include in the booking",
          },
          message: {
            type: "string",
            description: "Optional introductory message to the sitter",
          },
        },
        required: ["sitterId", "serviceType", "startDate", "endDate", "petIds"],
      },
    },
  • Zod validation schema (RequestBookingSchema) for runtime type checking of booking request parameters, including enum validation for serviceType.
    const RequestBookingSchema = z.object({
      sitterId: z.string().min(1),
      serviceType: z.enum(["boarding", "house_sitting", "drop_in", "doggy_day_care", "dog_walking"]),
      startDate: z.string().min(1),
      endDate: z.string().min(1),
      petIds: z.array(z.string()),
      message: z.string().optional(),
    });
  • TypeScript interface definition for BookingRequest, defining the shape of the booking request object with required and optional fields.
    export interface BookingRequest {
      sitterId: string;
      serviceType: string;
      startDate: string;
      endDate: string;
      petIds: string[];
      message?: string;
    }
  • The tool handler case statement that validates input using RequestBookingSchema, calls browser.requestBooking(), and formats the response content for the MCP protocol.
    case "request_booking": {
      const params = RequestBookingSchema.parse(args);
      const result = await browser.requestBooking(params);
      return {
        content: [
          {
            type: "text",
            text: result.success
              ? `Booking request sent! ${result.message}${result.bookingId ? ` Booking ID: ${result.bookingId}` : ""}`
              : `Failed to send booking request: ${result.message}`,
          },
        ],
      };

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/markswendsen-code/mcp-rover'

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