> ## Documentation Index
> Fetch the complete documentation index at: https://docs.adgenticplatform.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How It Works

> The Adgentic MCP server enables your agent to find the top-matching product for user prompts that contain commercial intent.

<Copy />

<AccordionGroup>
  <Accordion title="1) Detect commercial intent">
    * Your agent can run its own intent detection in user prompts
    * Or use Adgentic’s built-in intent analysis microservice

    **Built-in Adgentic Intent Classification**

    * Non-commercial → `{"response": false, "products": []}`
    * Commercial or Potential Commercial → `{"response": true, "products": [...]}`

    <Tip>
      If you’re unsure, send your raw user prompt to the MCP and let the gateway classify it.
    </Tip>
  </Accordion>

  <Accordion title="2) Call the MCP tool">
    **Tool:** `match_adgentic_products`

    * Pass the user’s `prompt` and optional `context` (e.g. `{ "country": "US" }`)
    * `country` helps return geo-relevant offers (shipping/availability)
    * Include your `api_key` unless it’s set in the MCP server environment

    ```json Minimal request payload JSON theme={null}
    {
      "prompt": "I am training for a marathon and I need a waterproof smartwatch under $300",
      "api_key": "<YOUR_KEY>",
      "context": { "country": "US" }
    }
    ```
  </Accordion>

  <Accordion title="3) Adgentic matches products">
    * **Commercial intent** → best-matching products (max. 5 offers)
    * **Potential commercial** → multiple relevant products
    * **Non-commercial** → `{"response": false, "products": []}`

    ```json Example products shape theme={null}
    {
    "response": true,
    "products": [
    {
      "basic_identity": {
        "product_title": "Classic Red Sneakers",
        "product_description": "Red running shoes for men and women",
        "product_link": "https://shop.example.com/products/987",
        "product_image_link": "https://cdn.example.com/products/red-shoes.jpg",
        "currency": "USD",
        "price": 89.0,
        "availability": "In Stock",
        "brand": "Example Brand"
      },
      "physical_characteristics": {
        "color": "Red",
        "size": "US 9",
        "weight": "0.8 kg",
        "material": "Synthetic Mesh"
      },
      "technical_specs": {
        "sku": "SNK-RED-987",
        "dimensions": "30 x 10 x 12 cm"
      },
      "functional_features": {
        "water_resistant": false,
        "breathable": true,
        "slip_resistant": true
      },
      "compatability": {
        "gender": ["Men", "Women"],
        "sports": ["Running", "Casual Wear"]
      },
      "performance_metrics": {
        "durability_score": 8.5,
        "comfort_rating": 9.2
      },
      "content_and_packaging": {
        "box_contents": ["1 Pair Sneakers"],
        "packaging_material": "Recyclable Cardboard"
      },
      "warrant_and_certification": {
        "warranty_period": "12 months",
        "certifications": ["ISO 9001"]
      },
      "sustainability": {
        "eco_friendly_materials": true,
        "recyclable": true
      },
      "review_metrics": {
        "average_rating": 4.6,
        "review_count": 254
      },
      "user_context_tags": {
        "ideal_use_case": "Daily running and casual wear",
        "persona_fit": "Active lifestyle, fashion-conscious",
        "lifestyle_alignment": "Urban, sporty"
      },
      "advertiser_info": {
        "advertiser_name": "Example Shop",
        "advertiser_website": "https://shop.example.com",
        "advertiser_logo": "https://cdn.example.com/logo.png",
        "advertiser_category": "Footwear & Apparel"
      },
      "monetization_info": {
        "commission_rate": "12%",
        "referral_period": "30 days"
      }
    }
    ]
    }
    ```
  </Accordion>
</AccordionGroup>

<hr />

<div style={{display:'flex', alignItems:'center', gap:'8px', marginTop:'8px'}}>
  <span style={{ color: 'var(--mint-c-text)', fontWeight: 600 }}>
    Was this page helpful?
  </span>

  <a href="mailto:hello@adgenticplatform.com?subject=Docs%20feedback%20YES" title="Yes">👍 Yes</a>
  <span aria-hidden="true">·</span>
  <a href="mailto:hello@adgenticplatform.com?subject=Docs%20feedback%20NO" title="No">👎 No</a>
</div>
