How to use SerpApi engine schemas in SerpApi MCP to improve tool call quality

Published: (February 3, 2026 at 08:16 AM EST)
4 min read
Source: Dev.to

Source: Dev.to

Quick Recap: SerpApi MCP in Your Workflow

SerpApi MCP lets you connect AI tools (like Claude Desktop, Cursor, VS Code MCP‑compatible extensions, or your custom AI agents) directly to SerpApi’s live search infrastructure.

Once configured, your AI assistant can:

  • Discover available search engines
  • Call the search tool with structured parameters
  • Receive normalized JSON results

If you haven’t set it up yet, you’ll need a SerpApi API key. You can obtain one here.

Add SerpApi MCP to your MCP configuration:

{
  "mcpServers": {
    "serpapi": {
      "url": "https://mcp.serpapi.com/YOUR_SERPAPI_API_KEY/mcp"
    }
  }
}

Once connected, your AI assistant can immediately start interacting with SerpApi tools and resources.


What’s New: Engine Schemas as MCP Resources

Previously, the LLM had to guess which parameters each SerpApi engine accepted or rely on hard‑coded knowledge.
Now, each engine exposes its own schema as an MCP resource.

What This Means

With the new feature, MCP exposes:

  • A list of available engines
  • A detailed parameter schema for each engine

Conceptually:

ResourceDescription
serpapi://enginesLists all supported engines
serpapi://engines/google_flightsReturns the schema for Google Flights
serpapi://engines/google_shoppingReturns the schema for Google Shopping

Each schema describes:

  • Parameter names
  • Data types
  • Optional vs. required fields
  • Parameter descriptions

This gives AI agents a real‑time contract for every engine.


How Engine Schemas Improve Tool‑Call Quality

This upgrade solves several real‑world problems when building AI‑powered integrations.

  1. No more guessing parameter names
    Instead of inventing fields like origin or destination, the agent can see the real API fields such as:

    • departure_id
    • arrival_id
    • departure_date
  2. Engine‑specific optimization
    Each SerpApi engine has its own unique features. Schemas allow the assistant to:

    • Use flight‑specific filters for Google Flights
    • Use price ranges for Google Shopping
    • Use topic tokens for Google News
  3. Fewer failed requests
    When parameters are generated directly from the schema:

    • Invalid arguments are avoided
    • Missing required fields are detected earlier
    • Requests become deterministic and repeatable
  4. Better developer experience
    In IDEs like VS Code, schemas unlock:

    • Better prompt grounding
    • Smarter auto‑completion
    • Self‑documenting integrations

Example: Using Google Flights with MCP Engine Schemas

Let’s walk through a real example. Imagine you want your AI assistant to search for round‑trip flights from San Francisco (SFO) to New York (JFK).

Step 1 – Discover Available Engines

serpapi://engines

The response includes (among others):

  • google_search
  • google_news
  • google_shopping
  • google_flights

The agent selects google_flights.

Step 2 – Load the Google Flights Schema

serpapi://engines/google_flights

The returned schema lists supported parameters such as:

  • departure_id
  • arrival_id
  • departure_date
  • return_date
  • currency
  • travel_class

Now the assistant knows exactly what Google Flights accepts.

Step 3 – Make a Structured Search Call

{
  "name": "search",
  "arguments": {
    "params": {
      "engine": "google_flights",
      "departure_id": "SFO",
      "arrival_id": "JFK",
      "departure_date": "2026-03-15",
      "return_date": "2026-03-20",
      "currency": "USD"
    }
  }
}

Because the parameters match the schema:

  • The request is valid
  • No field guessing is involved
  • Results are returned immediately

The response contains structured flight data (prices, airlines, durations, layovers, etc.).


Example: Shopping Search with Google Shopping

Schemas are just as powerful for product search. Suppose you want to find wireless earbuds under $100.

Load the Engine Schema

serpapi://engines/google_shopping

You’ll discover parameters such as:

  • q
  • min_price
  • max_price
  • gl (geolocation)
  • hl (language)
{
  "name": "search",
  "arguments": {
    "params": {
      "engine": "google_shopping",
      "q": "wireless earbuds",
      "min_price": 10,
      "max_price": 100,
      "gl": "us",
      "hl": "en"
    }
  }
}

The schema ensures that the request is well‑formed, reducing errors and improving the relevance of the returned product listings.

✅ Checklist

  • The right filter fields are used
  • The query structure matches the engine
  • The response is clean and predictable

Using Schemas Inside VS Code

VS Code is one of the most popular environments for MCP‑powered workflows.

With SerpApi MCP configured you can:

  • Dynamically load engine schemas
  • Generate valid tool calls
  • Iterate on search logic without switching tabs

Example Workflows

  • “Find the cheapest flights under $500”
  • “Track shopping price drops”
  • “Monitor breaking news by topic”

All are powered by real‑time, schema‑driven requests.


Summary: Why This Feature Matters

By exposing engine schemas as MCP resources, SerpApi MCP becomes:

  • More reliable
  • More developer‑friendly
  • More automation‑ready

You get:

  • Accurate parameter generation
  • Engine‑aware AI behavior
  • Lower error rates
  • Faster integration cycles

This turns SerpApi MCP into a self‑describing API layer for AI agents.


Get Started Today

  1. Create a SerpApi account
  2. Enable MCP using your API key
  3. Connect from VS Code, Claude Desktop, or Cursor

Start exploring:

serpapi://engines

If you’re building AI‑powered tools that rely on search, shopping data, travel data, or news intelligence—engine schemas will dramatically improve the quality and reliability of your integrations.

Back to Blog

Related posts

Read more »