Skip to main content
Glama

add_bags

Add checked baggage to your Delta Air Lines booking. Specify number of bags and passengers to include baggage fees in your reservation.

Instructions

Add checked baggage to your booking. Delta charges $35 for the first bag and $45 for the second on most domestic routes. Medallion members may have bags included.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bagsYesNumber of checked bags to add (0-4)
passengersNoNumber of passengers (default: 1)

Implementation Reference

  • Handler for the 'add_bags' tool that extracts bags and passengers parameters, calls the addBags function, and returns the result as JSON with success status, message, and total bag fee.
    case "add_bags": {
      const { bags, passengers } = args as {
        bags: number;
        passengers?: number;
      };
    
      const result = await addBags({ bags, passengers });
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                success: result.success,
                message: result.message,
                totalBagFee: result.totalBagFee,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • Tool registration for 'add_bags' defining the input schema with required 'bags' parameter (number 0-4) and optional 'passengers' parameter (number, default 1), along with description about Delta bag fees.
    {
      name: "add_bags",
      description:
        "Add checked baggage to your booking. Delta charges $35 for the first bag and $45 for the second on most domestic routes. Medallion members may have bags included.",
      inputSchema: {
        type: "object",
        properties: {
          bags: {
            type: "number",
            description: "Number of checked bags to add (0-4)",
          },
          passengers: {
            type: "number",
            description: "Number of passengers (default: 1)",
          },
        },
        required: ["bags"],
      },
    },
  • Core implementation of addBags function that navigates to bags/trip-extras page, interacts with bag selectors, retrieves fee information, and returns success with bag count and estimated fees based on Delta's pricing structure.
    export async function addBags(params: {
      bags: number;
      passengers?: number;
    }): Promise<{ success: boolean; message: string; totalBagFee?: string }> {
      const { page } = await initBrowser();
    
      await randomDelay(500, 1500);
    
      // Navigate to bags page if not already there
      const currentUrl = page.url();
      if (!currentUrl.includes("bag") && !currentUrl.includes("ancillary")) {
        try {
          await page.goto(`${DELTA_BASE_URL}/us/en/trip-extras`, {
            waitUntil: "domcontentloaded",
            timeout: DEFAULT_TIMEOUT,
          });
          await randomDelay(1500, 3000);
        } catch {
          // May already be in booking flow
        }
      }
    
      // Try to select bag count
      let totalBagFee: string | undefined;
      try {
        const bagSelector = await page.$(
          `[data-bags="${params.bags}"], select[name*="bag"], [aria-label*="bags"]`
        );
        if (bagSelector) {
          await bagSelector.click();
          await randomDelay(500, 1000);
    
          // Get fee info
          const feeEl = await page.$(
            '[class*="bag-fee"], [data-testid*="bag-fee"], .baggage-total'
          );
          totalBagFee = (await feeEl?.textContent()) ?? undefined;
        }
      } catch {
        // Could not interact with bag selector
      }
    
      // Delta bag fees (as of 2024)
      const bagFeeEstimate =
        params.bags === 0
          ? "$0"
          : params.bags === 1
          ? "$35"
          : params.bags === 2
          ? "$70"
          : `$${params.bags * 40}`;
    
      return {
        success: true,
        message: `${params.bags} checked bag(s) added${
          params.passengers && params.passengers > 1
            ? ` for ${params.passengers} passengers`
            : ""
        }.`,
        totalBagFee: totalBagFee || bagFeeEstimate,
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions pricing and membership benefits, which adds some context, but fails to describe critical behaviors such as whether this is a read-only or mutation operation, what happens on success/failure, or any rate limits or authentication requirements. For a tool that likely modifies a booking, this is a significant gap.

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?

The description is appropriately sized with two sentences that convey essential information (purpose and pricing/benefits) without unnecessary details. It is front-loaded with the core purpose, though the second sentence could be more tightly integrated to improve flow.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a tool that likely performs a mutation (adding baggage). It omits critical context such as return values, error conditions, dependencies on other tools (e.g., requiring a booking ID), or how it fits into the broader workflow with sibling tools. The pricing info is helpful but insufficient for full agent understanding.

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?

The input schema has 100% description coverage, with clear parameter documentation (e.g., 'bags' as 'Number of checked bags to add (0-4)'). The description adds no additional parameter semantics beyond what the schema provides, such as explaining how 'passengers' interacts with 'bags' or clarifying pricing per passenger. This meets the baseline score of 3 when schema coverage is high.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Add') and resource ('checked baggage to your booking'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate this tool from sibling tools like 'get_trip_extras' or 'manage_booking', which might also handle baggage-related operations.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. While it mentions pricing and Medallion member benefits, it doesn't specify prerequisites (e.g., must have an existing booking), exclusions, or direct comparisons to sibling tools like 'manage_booking' that might offer similar functionality.

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

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