> 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/en/build/integrate.md).

# Use Cases: External Data Integration

External Data Integration

In real-world scenarios, an Agent often needs to access "real-time data" or "external system data" beyond the knowledge base in order to provide accurate and timely responses. With MaiAgent's tools (API tools and MCP tools), you can connect data sources from internal enterprise systems or third-party platforms to your Agent, 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 Agent to obtain the latest public data in real time.
* **Internal Enterprise System Queries**: Connect to internal APIs such as ERP, CRM, HR, and ticketing systems so the Agent can provide personalized information based on the employee's or customer's identity.
* **Third-Party SaaS Integration**: Connect to services such as Slack, Notion, Google Drive, and Salesforce to integrate the Agent into existing workflows.
* **Dynamic Queries and Reports**: When the data volume is large or changes frequently and is not suitable for a knowledge base, the Agent can respond by querying APIs in real time instead.

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

1. **Obtain the Data Source**: Identify the API or MCP service you want to connect, and prepare the endpoint, HTTP method, headers, and parameter structure.
2. **Create the Tool**: On the <mark style="color:blue;">Tools</mark> page of the MaiAgent platform, click <mark style="color:blue;">Add API Tool</mark> or <mark style="color:blue;">Add MCP Tool</mark>. When adding 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 Agent**: Add the tool to the Agent's list of available tools, and use role instructions to guide the Agent on when to call the tool.
4. **Test and Go Live**: Test the tool invocation flow through conversation, and check the execution status and error messages in <mark style="color:blue;">Tool Execution Records</mark> under AgentOps. Once you have confirmed the responses are correct, you can go live.

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

* [Agricultural Data Query](/maiagent-user-guide/en/build/integrate/farmingsearch.md): Integrate with the Ministry of Agriculture's public API to build an assistant that queries real-time agricultural product transaction prices.
* [Google Workspace Connector](/maiagent-user-guide/en/build/integrate/google-workspace-connector.md): Use the platform's built-in Google Workspace connector (MCP) to let the Agent query Gmail messages and attachments, Google Calendar events, and Google Drive documents.

The following sections use real-world cases to demonstrate 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 by asking a question.

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

```
GET https://docs.maiagent.ai/maiagent-user-guide/en/build/integrate.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.
