> 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-ja/application/integrate.md).

# 外部データ連携

実際の運用シーンでは、AI アシスタントが正確かつタイムリーな回答を提供するために、ナレッジベース以外の「リアルタイムデータ」や「外部システムのデータ」へアクセスする必要が生じることがよくあります。MaiAgent のツール（API ツール、MCP ツール）機能を利用すれば、社内システムやサードパーティプラットフォームのデータソースを AI アシスタントに連携でき、システムをまたいだ検索やリアルタイム応答が可能なスマートアプリケーションを構築できます。

### 活用シーン <a href="#use-cases" id="use-cases"></a>

* **公開データプラットフォームとの連携**：たとえば政府のオープンデータ（農業、気象、交通、財政）と連携し、AI アシスタントが最新の公開データをリアルタイムで取得できるようにします。
* **社内システムの照会**：ERP、CRM、HR、チケットシステムなどの社内 API と連携し、AI アシスタントが従業員や顧客の属性に応じてパーソナライズされた情報を提供できるようにします。
* **サードパーティ SaaS との統合**：Slack、Notion、Google Drive、Salesforce などのサービスと連携し、AI アシスタントを既存のワークフローに組み込みます。
* **動的な照会とレポート**：データ量が多い、または変動が頻繁でナレッジベースに格納するのが適さない場合は、API によるリアルタイム照会で回答する方式に切り替えられます。

### 連携フロー <a href="#integration-workflow" id="integration-workflow"></a>

1. **データソースの取得**：連携したい API または MCP サービスを確認し、エンドポイント、HTTP メソッド、ヘッダー、パラメータ構造を準備します。
2. **ツールの作成**：MaiAgent プラットフォームの <mark style="color:blue;">ツール</mark> ページで <mark style="color:blue;">API ツールを新規追加</mark> または <mark style="color:blue;">MCP ツールを新規追加</mark> をクリックします。API ツールを新規追加する際は cURL コマンドをそのまま貼り付けることができ、システムが URL、ヘッダー、HTTP メソッドを自動的に解析します。
3. **AI アシスタントの設定**：ツールを AI アシスタントの利用可能なツール一覧に追加し、ロール指示を通じて適切なタイミングでツールを呼び出すよう AI アシスタントを誘導します。
4. **テストと公開**：対話を通じてツール呼び出しのフローをテストし、AgentOps 配下の <mark style="color:blue;">ツール実行履歴</mark> で実行状況やエラーメッセージを確認します。回答が正しいことを確認できたら、公開して利用を開始できます。

### 活用例 <a href="#examples" id="examples"></a>

* [農業データの照会](/maiagent-user-guide/maiagent-user-guide-ja/application/integrate/farmingsearch.md)：農業部の公開 API と連携し、農産物の取引相場をリアルタイムで照会できるアシスタントを構築します。

以降の各セクションでは、実際のケースを通じて外部データ連携の手順を示し、ご自身の業務シーンへ素早く応用していただけるようサポートします。


---

# 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-ja/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.
