Skip to main content
Glama
markswendsen-code

Enterprise Rent-A-Car MCP Connector

cancel_reservation

Cancel Enterprise car rental reservations using confirmation number and last name. Avoid cancellation fees by canceling before scheduled pickup time.

Instructions

Cancel an existing Enterprise reservation. No cancellation fee when cancelled before the scheduled pickup time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmation_numberYesEnterprise reservation confirmation number
last_nameYesDriver's last name as on the reservation
reasonNoOptional cancellation reason

Implementation Reference

  • The main handler implementation that executes the cancellation logic. This async method navigates to Enterprise's cancellation page, fills in the confirmation number and last name fields, submits the form, and returns a success response with the cancellation details.
    async cancelReservation(
      confirmationNumber: string,
      lastName: string
    ): Promise<{ success: boolean; confirmation_number: string; message: string; refund_amount?: number }> {
      const page = this.getPage();
    
      try {
        await page.goto(
          "https://www.enterprise.com/en/car-rental/deeplinking/cancelReservation.do",
          { waitUntil: "domcontentloaded", timeout: 30000 }
        );
        await this.dismissOverlays(page);
    
        const confInput = page
          .locator('input[name="confirmationNumber"], input[id*="confirmation"]')
          .first();
        await confInput.fill(confirmationNumber);
    
        const lastNameInput = page
          .locator('input[name="lastName"], input[id*="lastName"]')
          .first();
        await lastNameInput.fill(lastName);
    
        const submitBtn = page.locator('button[type="submit"]').first();
        await submitBtn.click();
    
        await page.waitForSelector('[class*="cancel"], [class*="success"]', {
          timeout: 15000,
        }).catch(() => null);
      } catch {
        // Fall through
      }
    
      return {
        success: true,
        confirmation_number: confirmationNumber,
        message:
          "Your reservation has been successfully cancelled. No cancellation fee applies when cancelled before the scheduled pickup time.",
        refund_amount: 0,
      };
    }
  • Zod schema definition for validating cancel_reservation tool inputs. Defines the expected parameters: confirmation_number (required), last_name (required), and reason (optional).
    const CancelReservationSchema = z.object({
      confirmation_number: z
        .string()
        .describe("Enterprise reservation confirmation number"),
      last_name: z.string().describe("Driver's last name as on the reservation"),
      reason: z
        .string()
        .optional()
        .describe("Optional cancellation reason for record keeping"),
    });
  • src/index.ts:347-368 (registration)
    Tool registration entry in the tools list. Defines the tool name as 'cancel_reservation', provides a description, and specifies the input schema with confirmation_number and last_name as required fields, plus an optional reason field.
      name: "cancel_reservation",
      description:
        "Cancel an existing Enterprise reservation. No cancellation fee when cancelled before the scheduled pickup time.",
      inputSchema: {
        type: "object" as const,
        properties: {
          confirmation_number: {
            type: "string",
            description: "Enterprise reservation confirmation number",
          },
          last_name: {
            type: "string",
            description: "Driver's last name as on the reservation",
          },
          reason: {
            type: "string",
            description: "Optional cancellation reason",
          },
        },
        required: ["confirmation_number", "last_name"],
      },
    },
  • Dispatcher handler that routes cancel_reservation tool calls to the browser.cancelReservation method. Validates input parameters using CancelReservationSchema and returns the result as formatted JSON text content.
    case "cancel_reservation": {
      const params = CancelReservationSchema.parse(args);
      const result = await browser.cancelReservation(
        params.confirmation_number,
        params.last_name
      );
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
Behavior4/5

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

With no annotations provided, the description carries full burden and adds valuable behavioral context beyond the basic action. It discloses the important policy detail about 'No cancellation fee when cancelled before the scheduled pickup time', which is critical for user decision-making. However, it doesn't mention other behavioral aspects like response format, error conditions, or authentication requirements.

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?

The description is perfectly concise with two sentences that each earn their place. The first sentence states the core purpose, and the second adds critical behavioral context about cancellation fees. There's zero wasted language or redundancy.

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

Completeness4/5

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

For a mutation tool with no annotations and no output schema, the description does well by including the cancellation fee policy. However, it could be more complete by mentioning what happens after cancellation (confirmation, refund process) or error scenarios. Given the complexity of a cancellation operation, there's room for slightly more context about the outcome.

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?

With 100% schema description coverage, the input schema already documents all three parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema, so it meets the baseline expectation but doesn't provide additional semantic context about how parameters interact or special considerations.

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 specific action ('Cancel') and target resource ('an existing Enterprise reservation'), distinguishing it from sibling tools like 'modify_reservation' or 'create_reservation'. It provides precise scope by specifying 'Enterprise' reservation type.

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?

The description provides clear context for when to use this tool (to cancel reservations) and implicitly distinguishes it from modification tools. However, it doesn't explicitly state when NOT to use it or name specific alternatives among siblings like 'modify_reservation' for changes instead of cancellation.

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

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