> For the complete documentation index, see [llms.txt](https://docs.nosto.com/techdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nosto.com/techdocs/implementing-nosto/implement-lim-skill-early-access/architecture-and-integration-overview/mcp.md).

# MCP

For agent-native systems, LIM is also available via MCP, allowing it to be exposed as a callable tool within an LLM-orchestrated workflow.

This enables:

* Tool-based invocation from agents.
* Cleaner separation between reasoning and retrieval.
* Easier orchestration in IDEs and agent frameworks that support MCP.

You can use an [MCP inspector](https://github.com/modelcontextprotocol/inspector) to test the MCP protocol locally.

#### MCP tool

The currently registered MCP tool is:

* `getRecommendation`&#x20;

#### Authentication

Requests must include a bearer token in the header.

```
Authorization: Bearer xxx-xx-xxxxxxxxxxxx
```

#### Request Payload

At a minimum, LIM requires the fields below:

* `prompt` **:** Free-form text describing the inferred user intent.\
  This can be:
  * A direct user prompt
  * A normalized intent string generated by an agent
  * A short task-oriented description (e.g. “a gift for a tea lover”)
* `customerId` **:** The Nosto unique identifier representing the shopper.

  Used to enable session-level and cross-session personalization when available.\
  Partners can get the customerId by accessing the Nosto's 2c.cId cookie for each visitor.
* `partnerId` **(NEW):** Your unique Nosto partner identifier provided by the partner management team.
* `chatId` **(NEW):** Your unique identifier for the conversation, to help answer follow up questions within a conversation

Example request:

```
{
  "prompt": "What dresses do you recommend for a summer party?",
  "customerId": "xxxxx",
  "partnerId": "xx-xxxxxx",
  "chatId": "xxxxx"
}
```

**Required Fields for Shopify Merchants (NEW):**

For merchants using Shopify Markets, Nosto LIM resolves the correct catalog — currency, availability, and language — based on the storefront's country and locale. To support this, partners must send two additional fields for **all Shopify merchants**:

* `country` **:** The ISO 3166 alpha-2 country code of the Shopify store. [Supported values](https://shopify.dev/docs/api/storefront/latest/enums/CountryCode).
* `locale` **:** The language code of the Shopify store. [Supported values](https://shopify.dev/docs/api/admin-graphql/latest/enums/LanguageCode).

> **Note:** Shopify Markets merchants authenticate using the API token from their Nosto Markets Master account, not a per-storefront token. This is the single account Nosto uses to resolve catalog data across all connected markets — see Authentication.

**Optional Fields:**

LIM supports the following optional fields:

* **Ranking-Only Mode:** The tool supports a `rankingOnly` (boolean) flag that controls how the LLM processes product results:
  * `rankingOnly`: `false` (default): The LLM returns both a ranked selection of products and the agent response (a natural language conversational response).
  * `rankingOnly`: `true`: The LLM only ranks/selects the best matching products without generating agent insights. Using this option reduces latency.
* **Max Agent Recommendations Controls:** The tool supports the `maxAgentRecommendations`  (integer | null) field that controls the number of products returned. The default is 3, and the value range is 1 to 20.
* **Agent Context:** The tool supports the `giveAgentContext` (boolean) flag. When `true`, LIM returns a concise context describing why LIM selected the returned products.
* **Agent Insight Format:** The /api endpoint supports the `responseFormat` (string) field to define how the natural language response is returned; by default is plain text, but for partners looking to show the response directly to shoppers, the `markdown` option is also supported.&#x20;

#### Response

Nosto LIM returns a ranked list of product recommendations, suitable for direct rendering or further reasoning by an agent.

* `agentInsight` : A natural language conversational response (returned by default. When the flag `rankingOnly` is set to true, it's returned as an empty string)

> Example “*These shoes feature air-cushioned soles: Dr. Martens Cherry Shoe - An original 3-eye shoe with distinctive air-cushioned soles and classic Docs DNA, priced at €100. 3989 Bex Brogue - This shoe combines durability and comfort with Dr. Martens’ air-cushioned sole, priced at €120. NMD\_R1 Primeknit ‘Tricolor Black’ - Offers responsive cushioning with a Boost sole, priced at €100.*”

* `agentContext`: A concise context for agents describing why LIM selected the returned products (returned when the `giveAgentContext` flag is set to true)

> Example: "*User asks for a sweater recommendation for summer; shopping intent true; Selected in-catalog 100% cashmere sweaters as lightweight layering options; Chose 3 products from the keyword/vector summer cashmere search results*"

* `agentProductRecommendations` : A list of products based on agentic recommendations (which combines Nosto Semantic Search, Core Recommendation Pipeline with Predictive, Semantic, and Visual AI + LLM ranking)

<pre class="language-json"><code class="lang-json">agentProductRecommendations (array&#x3C;object> | null)
    Any of (array&#x3C;object> | null)
            Items object
                productId string
                name (string | null)
                url (string | null)
                description (string | null)
                imageUrl (string | null)
                price (number | null)
                currencyCode (string | null)
                brand (string | null)
<strong>                availability (string | null)
</strong>                priceCurrencyCode (string | null)
                listPrice (number | null)
                ratingValue (number | null)
                reviewCount (integer | null)
                inventoryLevel (integer | null)
                isExcluded (boolean | null)
                onDiscount (boolean | null)
                skus (array&#x3C;object> | null)
<strong>                    Any of (array&#x3C;object> | null)
</strong><strong>                        Items object
</strong>                            id string
                            inventoryLevel (integer | null)
                            availability (string | null)
                            name(string | null)
</code></pre>

#### MCP server Configuration

The following configuration can be used with MCP-compatible tools and IDEs (e.g. Cursor):

```
{
  "mcpServers": {
    "nosto-lim": {
      "transport": "streamable-http",
      "url": "https://lim.nosto.com/mcp",
      "headers": {
        "Authorization": "Bearer xxxx-xxx-xxxxxxxxxxxxx"
      }
    }
  }
}
```

Once configured, LIM becomes available to the agent as a callable external capability.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nosto.com/techdocs/implementing-nosto/implement-lim-skill-early-access/architecture-and-integration-overview/mcp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
