> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/application/integrate.md).

# External Data Integration

In real-world scenarios, AI assistants often need to access "real-time data" or "external system data" beyond the knowledge base in order to provide accurate and timely responses. Through MaiAgent's tools (API tools and MCP tools), you can connect data sources from internal enterprise systems or third-party platforms to your AI assistant, building intelligent applications that can query across systems and respond in real time.

### Use Cases <a href="#use-cases" id="use-cases"></a>

* **Public Data Platform Integration**: For example, government open data (agriculture, weather, transportation, finance), allowing the AI assistant to obtain the latest public data in real time.
* **Internal Enterprise System Queries**: Integrate with internal APIs such as ERP, CRM, HR, and ticketing systems, so the AI assistant can provide personalized information based on employee or customer identity.
* **Third-Party SaaS Integration**: Connect to services such as Slack, Notion, Google Drive, and Salesforce to embed the AI assistant into existing workflows.
* **Dynamic Queries and Reports**: When data volume is large or changes frequently and is not suitable for the knowledge base, queries can be made in real time through APIs instead.

### Integration Workflow <a href="#integration-workflow" id="integration-workflow"></a>

1. **Obtain the Data Source**: Identify the API or MCP service to be integrated, and prepare the endpoint, HTTP method, headers, and parameter structure.
2. **Create the Tool**: On the MaiAgent platform's <mark style="color:blue;">Tools</mark> page, click <mark style="color:blue;">New API Tool</mark> or <mark style="color:blue;">New MCP Tool</mark>. When creating an API tool, you can paste a cURL command directly and the system will automatically parse the URL, headers, and HTTP method.
3. **Configure the AI Assistant**: Add the tool to the AI assistant's list of available tools, and use role instructions to guide the AI assistant on when to call the tool.
4. **Test and Go Live**: Test the tool invocation flow through conversation, and review execution status and error messages on the <mark style="color:blue;">Tool Execution Records</mark> page under AgentOps to confirm response accuracy before going live.

### Examples <a href="#examples" id="examples"></a>

* [Agricultural Data Query](/maiagent-user-guide/maiagent-user-guide-en/application/integrate/farmingsearch.md): Build a real-time agricultural product transaction query assistant by integrating with the Ministry of Agriculture's public API.

The following sections will demonstrate, through concrete cases, how to complete external data integrations, helping you quickly apply them to your own business scenarios.


---

# 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.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/application/integrate.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.
