> For the complete documentation index, see [llms.txt](https://developer.emporix.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.emporix.io/import-tool/mcp-and-ai-agents.md).

# MCP and AI Agents

Use an AI agent to build and monitor imports. Attach Import Tool domain tools so the agent can create the import and watch how it runs.

Use an AI agent to build and monitor imports. Attach **Import Tool Domain Tools** so the agent can create jobs, streams, and mappings, work with existing connections, and check runs, errors, and imported records. When you create or edit an agent in the Management Dashboard, those tools are on the **Tools** tab.

{% hint style="info" %}
For how domain tools fit into Emporix MCP, see [Emporix MCP Server](https://developer.emporix.io/agentic-commerce-intelligence/mcp-in-emporix/mcp.md). For the full agent setup procedure, see [AI Agents guide](https://developer.emporix.io/agentic-commerce-intelligence/agentic-intelligence/agents.md).
{% endhint %}

## Attaching Import Tool domain tools

{% stepper %}
{% step %}

#### Open AI Agents

In **Management Dashboard**, go to **Agentic AI** -> **AI Agents**.
{% endstep %}

{% step %}

#### Open or create an agent

Open an existing agent, or choose **Add new agent** to create one. See [Creating a custom agent](https://developer.emporix.io/agentic-commerce-intelligence/agentic-intelligence/agents.md#creating-a-custom-agent).
{% endstep %}

{% step %}

#### Open the Tools tab

On the agent configuration page, choose the **Tools** tab.
{% endstep %}

{% step %}

#### Find Import Tool Domain Tools

In the tools search, enter `Import`. Open **Import Tool Domain Tools**. The group includes tools tagged **Import Job**, **Stream**, **Mapping**, **Run**, and **Connection**.

Choose the tools your agent needs, for example `create-import-job`, `create-import-stream`, `get-import-job`, or `cancel-import-run`. Then choose **Save**.
{% endstep %}
{% endstepper %}

<figure><img src="https://2637457592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9VS91qn3Ylwd58YivX1A%2Fuploads%2Fgit-blob-ce30b5aaa8d1ef3bc97aa46b514715680b24c7d4%2Fit_import_agent.png?alt=media" alt="New Agent Tools tab showing Import Tool Domain Tools after searching for Import"><figcaption><p>Import Tool Domain Tools on the agent Tools tab</p></figcaption></figure>

{% hint style="info" %}
The tools you attach determine what the agent can do with the Import Tool. Attach only the tools required for the agent's task. For attaching domain tools, native tools, and MCP servers, see [Attach tools](https://developer.emporix.io/agentic-commerce-intelligence/agentic-intelligence/agents.md#attach-tools) in the AI Agents guide.
{% endhint %}

## Import Tool MCP server

The Import Tool MCP server exposes tools the agent uses to build, run, and monitor imports. Tools that change state are marked as **writes**, so you can see at a glance which are safe to call while exploring.

| Item       | Value                                      |
| ---------- | ------------------------------------------ |
| Transports | `/mcp` · `/sse`                            |
| Config     | `IMPORTTOOL_URL` · `BASIC_AUTH` · `TENANT` |
| Scopes     | `import_trigger` · `import_manage`         |

### Jobs and streams

| Tool                   | Access | Description                                                                                                                                                                                      |
| ---------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `list-import-jobs`     | read   | Lists the tenant's import jobs. Start here — it yields the job ID every other tool needs.                                                                                                        |
| `get-import-job`       | read   | Returns one job, with its streams.                                                                                                                                                               |
| `create-import-job`    | writes | Creates an empty job.                                                                                                                                                                            |
| `update-import-job`    | writes | Changes a job's name, description, default connection, or enabled flag.                                                                                                                          |
| `create-import-stream` | writes | Adds a stream: one source dataset into one Emporix target type.                                                                                                                                  |
| `update-import-stream` | writes | Changes stream settings. Only the arguments supplied are touched.                                                                                                                                |
| `get-import-limits`    | read   | Returns the licence limits in force for the tenant — records per entity, concurrency, batch size, and workers.                                                                                   |
| `list-target-writers`  | read   | Lists the targets the Import Tool can write to, such as custom entities, products, categories, prices, stock, images, and category assignments, with the write strategies each one supports.     |
| `add-feed-target`      | writes | Adds a fan-out target to a stream, for example a product's prices, stock, images, or category assignments, written from the same records without reading the source again.                       |
| `check-stream-key`     | read   | Checks a stream's key against a live sample of the source and reports how many rows would be merged into one record, with what to change. Checks the saved key or a draft of it. Writes nothing. |

### Connections

| Tool                            | Access | Description                                                                                                                                                                                    |
| ------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `list-import-connections`       | read   | Lists the source connections available, and what each one connects to. Credentials are never returned.                                                                                         |
| `list-connection-resources`     | read   | Lists resources a connection's discovered schema offers — REST operations, GraphQL queries — so a stream can name one.                                                                         |
| `test-import-connection`        | read   | Checks that the connection can reach its source, and reports why if it cannot. Use this before you build streams on the connection.                                                            |
| `sample-connection`             | read   | Reads records live and reports the fields they contain, with an inferred type.                                                                                                                 |
| `create-import-connection`      | writes | Creates a source connection and its credential. Test it with `test-import-connection` before you build streams on it.                                                                          |
| `update-import-connection`      | writes | Changes a connection. Only the arguments supplied are touched, and the stored credential is kept unless a new one is given.                                                                    |
| `upload-connection-sample-file` | writes | Uploads a sample file to a File connection, so streams and mappings can be set up from its columns before any file is imported. A connection holds one sample, and the sample is not imported. |

### Files

The file tools work on the queue of a File stream: the files its next run imports, and the files it has already dealt with.

| Tool                   | Access | Description                                                                                                                   |
| ---------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------- |
| `list-stream-files`    | read   | Lists the files waiting to be imported, in load order, and the most recent files already dealt with, each with its status.    |
| `queue-stream-file`    | writes | Adds a file to the queue for the next run. A file whose content the stream has already imported is refused.                   |
| `reorder-stream-files` | writes | Sets the order the waiting files load in. For files that contain only changes, a later file's values win.                     |
| `remove-stream-file`   | writes | Takes a waiting file out of the queue and deletes its stored copy. Nothing already imported is changed.                       |
| `requeue-stream-file`  | writes | Puts a file whose import failed back in the queue, without uploading it again. Use it after you fix the cause of the failure. |

### Mappings

| Tool                       | Access | Description                                                                                                                      |
| -------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------- |
| `get-stream-mappings`      | read   | Returns a stream's mappings: each source field, the target attribute it writes to, and its declared type.                        |
| `list-source-fields`       | read   | Lists fields the source provides, with an inferred type and a sample value.                                                      |
| `list-target-fields`       | read   | Lists attributes the target type actually has, with each one's declared type. The declared type is authoritative.                |
| `list-target-types`        | read   | Lists custom-entity types that already exist on the tenant.                                                                      |
| `generate-stream-mappings` | writes | Matches source fields against the target's real attributes and saves the result. Not a dry run.                                  |
| `set-stream-mappings`      | writes | Replaces a stream's mappings with the list given.                                                                                |
| `preview-stream-mappings`  | read   | Runs sample records through the mappings and returns what would be written. Writes nothing.                                      |
| `publish-stream-mappings`  | writes | Publishes the saved draft so real runs use it. Until published, a stream's mappings are a draft and real runs skip it.           |
| `list-mapping-versions`    | read   | Lists published versions, newest first, and where the draft currently stands relative to them.                                   |
| `restore-mapping-version`  | writes | Replaces the draft with an earlier published version — step one of a rollback. Publish to make it live.                          |
| `check-schema-drift`       | writes | Compares the source's current fields against what the stream last saw. Advances the stored baseline, so it is not purely a read. |
| `list-transforms`          | read   | Lists transformations a mapping can apply, each with syntax, behaviour, and an example.                                          |

### Running

| Tool                     | Access | Description                                                                                         |
| ------------------------ | ------ | --------------------------------------------------------------------------------------------------- |
| `trigger-import-run`     | writes | Starts a run — full, incremental, or dry — and returns the run it created.                          |
| `cancel-import-run`      | writes | Stops a running import.                                                                             |
| `retry-failed-records`   | writes | Re-runs only a finished run's failed records, as a new run.                                         |
| `get-import-schedule`    | read   | Returns a job's schedule: cron expression, timezone, whether it is enabled, and when it next fires. |
| `set-import-schedule`    | writes | Creates or replaces a job's schedule.                                                               |
| `delete-import-schedule` | writes | Removes the schedule, so the job runs only when triggered.                                          |

### Monitoring

| Tool                    | Access | Description                                                                            |
| ----------------------- | ------ | -------------------------------------------------------------------------------------- |
| `list-import-runs`      | read   | Lists recent runs of a job, newest first.                                              |
| `get-import-run`        | read   | Returns one run: its status and record counters.                                       |
| `get-import-run-errors` | read   | Returns the per-record errors from a run — what failed and why.                        |
| `get-import-stats`      | read   | Returns aggregated statistics for a time window: totals, rates, and per-stream health. |
| `search-imported-data`  | read   | Searches the records this tenant has imported, optionally scoped to one stream.        |


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.emporix.io/import-tool/mcp-and-ai-agents.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
