Skip to main content
Glama
markswendsen-code

Enterprise Rent-A-Car MCP Connector

get_vehicle_details

Retrieve comprehensive vehicle details including pricing breakdown and available protection options for Enterprise Rent-A-Car reservations using a specific vehicle ID.

Instructions

Get detailed information, full pricing breakdown, and available protection options for a specific vehicle from search results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vehicle_idYesVehicle ID from search_vehicles results
rate_codeNoRate code for specific pricing tier

Implementation Reference

  • The main handler function that implements the get_vehicle_details tool logic. It accepts a vehicleId and optional rateCode, navigates to a page (with error handling), and returns detailed vehicle information including pricing breakdown and protection options.
    async getVehicleDetails(
      vehicleId: string,
      rateCode?: string
    ): Promise<VehicleResult & { rate_details: object; protection_options: object[] }> {
      const page = this.getPage();
    
      try {
        // Navigate to vehicle detail page (if available)
        await page.goto(
          `https://www.enterprise.com/en/car-rental/locations/us.html`,
          { waitUntil: "domcontentloaded", timeout: 15000 }
        );
      } catch {
        // Fall through to mock
      }
    
      return {
        vehicle_id: vehicleId,
        make_model: "Toyota Corolla or similar",
        vehicle_class: "Economy",
        transmission: "Automatic",
        passengers: 5,
        bags: 2,
        daily_rate: 39.99,
        total_rate: 39.99,
        currency: "USD",
        features: ["AC", "Bluetooth", "USB Charging", "Power Windows", "Power Locks"],
        availability: "Available",
        mileage_policy: "Unlimited",
        rate_code: rateCode ?? "STANDARD",
        rate_details: {
          base_rate: 39.99,
          taxes: 5.84,
          fees: 3.50,
          total_before_optional: 49.33,
          currency: "USD",
        },
        protection_options: [
          {
            id: "ldw",
            name: "Loss Damage Waiver (LDW)",
            description: "Covers damage to the rental vehicle with no out-of-pocket costs",
            daily_rate: 15.99,
            currency: "USD",
          },
          {
            id: "pai",
            name: "Personal Accident Insurance (PAI)",
            description: "Covers medical costs for you and your passengers",
            daily_rate: 4.99,
            currency: "USD",
          },
          {
            id: "pec",
            name: "Personal Effects Coverage (PEC)",
            description: "Covers theft of personal items from the rental vehicle",
            daily_rate: 2.99,
            currency: "USD",
          },
        ],
      } as VehicleResult & { rate_details: object; protection_options: object[] };
    }
  • Zod schema definition for input validation. Defines vehicle_id as required string and rate_code as optional string, with descriptions for each parameter.
    const GetVehicleDetailsSchema = z.object({
      vehicle_id: z.string().describe("Vehicle ID from search_vehicles results"),
      rate_code: z
        .string()
        .optional()
        .describe("Rate code for specific pricing tier"),
    });
  • src/index.ts:220-237 (registration)
    Tool registration block that defines the tool name 'get_vehicle_details', its description, and JSON Schema input schema for the MCP protocol.
      name: "get_vehicle_details",
      description:
        "Get detailed information, full pricing breakdown, and available protection options for a specific vehicle from search results.",
      inputSchema: {
        type: "object" as const,
        properties: {
          vehicle_id: {
            type: "string",
            description: "Vehicle ID from search_vehicles results",
          },
          rate_code: {
            type: "string",
            description: "Rate code for specific pricing tier",
          },
        },
        required: ["vehicle_id"],
      },
    },
  • The switch case dispatcher that handles 'get_vehicle_details' tool calls. It parses the input parameters using the Zod schema, invokes the browser.getVehicleDetails handler, and returns the result as JSON text content.
    case "get_vehicle_details": {
      const params = GetVehicleDetailsSchema.parse(args);
      const result = await browser.getVehicleDetails(
        params.vehicle_id,
        params.rate_code
      );
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }

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-enterprise'

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