Skip to main content
Glama

get-year-make-model

Retrieve comprehensive vehicle specifications, history, recalls, and market value by entering year, make, model, and optional trim.

Instructions

Get comprehensive vehicle info by year, make, model, and optional trim

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYesManufacturing year of the vehicle (e.g., 2023)
makeYesVehicle make (e.g., Toyota)
modelYesVehicle model (e.g., Camry)
trimNoVehicle trim (optional, e.g., XLE)

Implementation Reference

  • The main handler function for the 'get-year-make-model' tool. Defines the tool with Zod schema params (year, make, model, optional trim), calls the CarsXE API endpoint v1/ymm, and returns formatted response text.
    export function registerGetYearMakeModelTool(
      server: McpServer,
      getApiKey: () => string | null,
    ) {
      server.tool(
        "get-year-make-model",
        "Get comprehensive vehicle info by year, make, model, and optional trim",
        {
          year: z
            .string()
            .describe("Manufacturing year of the vehicle (e.g., 2023)"),
          make: z.string().describe("Vehicle make (e.g., Toyota)"),
          model: z.string().describe("Vehicle model (e.g., Camry)"),
          trim: z
            .string()
            .optional()
            .describe("Vehicle trim (optional, e.g., XLE)"),
        },
        async ({ year, make, model, trim }) => {
          const params: Record<string, string> = { year, make, model };
          if (trim) params.trim = trim;
          const apiKey = getApiKey();
          if (!apiKey) {
            return {
              content: [
                {
                  type: "text",
                  text: "❌ API key not provided. Please ensure X-API-Key header is set.",
                },
              ],
            };
          }
    
          const data = (await carsxeApiRequest<CarsXEYearMakeModelResponse>(
            "v1/ymm",
            params,
            apiKey,
          )) as CarsXEYearMakeModelResponse;
          if (!data || !data.success) {
            return {
              content: [
                {
                  type: "text",
                  text: `❌ Year/Make/Model lookup failed. ${
                    data?.message || "Unknown error."
                  }`,
                },
              ],
            };
          }
          return {
            content: [
              {
                type: "text",
                text: formatYearMakeModelResponse(data),
              },
            ],
          };
        },
      );
    }
  • TypeScript interface CarsXEYearMakeModelResponse defining the response shape including bestMatch (with name, year, make, model, pricing, colors, features, etc.), trimOptions, success, input, and message fields.
    export interface CarsXEYearMakeModelResponse {
      bestMatch?: {
        make: string;
        model: string;
        year: number | string;
        name: string;
        base_msrp: number;
        base_invoice: number;
        total_seating: number;
        color: {
          exterior: Array<{ name: string; rgb: string }>;
          interior: Array<{ name: string; rgb: string }>;
        };
        features: {
          standard: Array<{
            category: string;
            features: Array<{ name: string; value: string | null }>;
          }>;
          optional: Array<{
            category: string;
            features: Array<{ name: string; price?: number | null }>;
          }>;
        };
        is_truck: boolean;
        is_electric: boolean;
        is_plugin_electric: boolean;
      };
      trimOptions?: Array<any>;
      success: boolean;
      input: {
        year: string;
        make: string;
        model: string;
        trim?: string;
      };
      timestamp?: string;
      message?: string;
    }
  • src/MyMCP.ts:41-45 (registration)
    Registration of the tool in the MyMCP class (Cloudflare Workers agent), calling registerGetYearMakeModelTool(this.server, getApiKey).
      registerGetYearMakeModelTool(this.server, getApiKey);
      registerDecodeObdCodeTool(this.server, getApiKey);
      registerRecognizePlateImageTool(this.server, getApiKey);
      registerGetLienTheftTool(this.server, getApiKey);
    }
  • src/index.gcp.ts:57-60 (registration)
    Registration of the tool in the GCP-based HTTP server, calling registerGetYearMakeModelTool(server, getApiKey) inside registerAllTools.
    registerGetYearMakeModelTool(server, getApiKey);
    registerDecodeObdCodeTool(server, getApiKey);
    registerRecognizePlateImageTool(server, getApiKey);
    registerGetLienTheftTool(server, getApiKey);
  • Formatter helper that converts the CarsXEYearMakeModelResponse into a readable string output with vehicle details, MSRP, colors, and features.
    export function formatYearMakeModelResponse(
      data: import("../types/carsxe.js").CarsXEYearMakeModelResponse,
    ): string {
      if (!data.success) {
        return `❌ Year/Make/Model lookup failed. ${
          data.message || "Unknown error."
        }`;
      }
      if (!data.bestMatch) {
        return `No matching vehicle found for the specified year, make, and model.`;
      }
      const v = data.bestMatch;
      const lines = [
        `### 🚘 Year/Make/Model Lookup`,
        `**Name:** ${v.name}`,
        `**Year:** ${v.year}`,
        `**Make:** ${v.make}`,
        `**Model:** ${v.model}`,
        `**Base MSRP:** $${v.base_msrp.toLocaleString()}`,
        `**Base Invoice:** $${v.base_invoice.toLocaleString()}`,
        `**Seating:** ${v.total_seating}`,
        v.is_truck ? `**Truck:** Yes` : undefined,
        v.is_electric ? `**Electric:** Yes` : undefined,
        v.is_plugin_electric ? `**Plug-in Hybrid:** Yes` : undefined,
        "",
        v.color?.exterior?.length
          ? `**Exterior Colors:**\n${v.color.exterior
              .map((c: any) => `- ${c.name} (RGB: ${c.rgb})`)
              .join("\n")}`
          : undefined,
        v.color?.interior?.length
          ? `**Interior Colors:**\n${v.color.interior
              .map((c: any) => `- ${c.name} (RGB: ${c.rgb})`)
              .join("\n")}`
          : undefined,
        "",
        v.features?.standard?.length
          ? `**Standard Features:**\n${v.features.standard
              .map(
                (cat: any) =>
                  `- **${cat.category}:**\n${cat.features
                    .map(
                      (f: any) => `  - ${f.name}${f.value ? `: ${f.value}` : ""}`,
                    )
                    .join("\n")}`,
              )
              .join("\n")}`
          : undefined,
        v.features?.optional?.length
          ? `**Optional Features & Packages:**\n${v.features.optional
              .map(
                (cat: any) =>
                  `- **${cat.category}:**\n${cat.features
                    .map(
                      (f: any) =>
                        `  - ${f.name}${
                          f.price !== undefined && f.price !== null
                            ? ` ($${f.price})`
                            : ""
                        }`,
                    )
                    .join("\n")}`,
              )
              .join("\n")}`
          : undefined,
      ];
      return lines.filter(Boolean).join("\n\n");
    }
Behavior2/5

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

With no annotations, the description must disclose behavioral traits. However, it only mentions 'comprehensive vehicle info' without specifying what that includes (e.g., specs, recalls, images), any side effects (e.g., mutating data), or required permissions. This is insufficient for a tool with no annotation safety net.

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 a single, concise sentence that starts with the action verb 'Get'. It is not verbose, but could benefit from additional context without becoming overly long.

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 no output schema, the description should explain what 'comprehensive vehicle info' entails (e.g., returned fields, format). It also fails to mention any constraints (e.g., valid year range, supported makes/models). The tool's complexity (4 params, no output schema) demands a richer description.

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 description coverage is 100%, so the baseline is 3. The description adds 'comprehensive' and notes trim is optional, but these details are already implicit in the schema. No new semantic information beyond the schema is provided.

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 tool's purpose: retrieving comprehensive vehicle information based on year, make, model, and optional trim. It uses a specific verb ('Get') and resource ('vehicle info'), differentiating it from sibling tools that handle decoding plates, market values, or history.

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?

No guidance is provided on when to use this tool versus its siblings (e.g., get-vehicle-specs, get-vehicle-history). The description does not indicate any prerequisites or limitations, leaving the agent without context for selection.

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/carsxe/carsxe-mcp-server'

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