Agricultural data queries
Use case: Building a real-time agricultural data query assistant
If you work in agriculture — for example as a farmer, wholesaler, retailer, or a public-sector policymaker related to agriculture — to analyze and forecast market prices and trading trends of various agricultural products (such as rice, fruit, vegetables, livestock products, etc.), you can connect to the Ministry of Agriculture's public API to query agricultural product transaction data in real time, enabling further data analysis and improving decision-making efficiency.
Application process
1. Create a tool for querying agricultural product market transactions
Obtain API configuration
First, you can visit the API section of the Agricultural Data Open Platform to obtain the data sources you need according to your requirements.
Here we use agricultural product transaction market data as an example for building the tool. In the Parameters section click "Try it out" button, then click "Execute"to obtain the API configuration data.


Create an API tool
On the MaiAgent platform, click "Tools" in the left sidebar, then click "Add Tool"

Enter a display name and tool name, choose API for the tool type, and fill in the description for this tool
In the API configuration below, you can paste a screenshot of the API information interface from the Agricultural Data Open Platform into the MaiAgent tool creation assistant to quickly obtain the API URL, HTTP method, headers, and parameter structure.

API URL example:
https://data.moa.gov.tw/api/v1/AgriProductsTransType/
HTTP method example:
GET
Headers (JSON) example:
{
"Accept": "application/json"
}
Parameter structure (JSON Schema) example:
{
"type": "object",
"required": [
"Start_time",
"End_time"
],
"properties": {
"End_time": {
"type": "string",
"description": "Query end date (format: Minguo year.month.day, e.g.: 107.07.10)"
},
"Start_time": {
"type": "string",
"description": "Query start date (format: Minguo year.month.day, e.g.: 107.07.01)"
}
}
}
2. Create an agricultural data query AI assistant
Create AI
On the MaiAgent platform, click "AI" in the left sidebar, then click "Create AI Assistant"

For the response mode select "Agent" and enter the role instructions

Assign tools to the AI assistant
Select the "Tools" tab, then click "+Select Tools"

Choose the agricultural product market query tool you just created and confirm

3. AI assistant go-live and application
Now you can ask questions directly through the AI assistant’s Q&A interface to quickly query information such as product transaction volumes and changes in average prices, allowing you to grasp market prices and trading trends in real time and facilitating further data analysis and improved decision-making efficiency!

You can also go to the MaiAgent platform’s "All Conversations" feature to view the tool invocation records used when the AI assistant replied.

Last updated
Was this helpful?