# AgroLog MCP

> AgroLog monitors stored grain conditions in real time, letting you check temperature, moisture content, CO2 spoilage levels, and silo fill amounts from any AI agent. You can also remotely activate or deactivate aeration fans and dryers. Use this MCP to manage entire storage facilities—from reading current sensor readings to pulling historical trends for quality reports.

## Overview
- **Category:** iot-hardware
- **Price:** Free
- **Tags:** grain-monitoring, sensor-data, moisture-tracking, temperature-sensors, aeration-control, crop-management

## Description

Running a grain operation means managing complex variables: temperature spikes, moisture creep, CO2 buildup, and accurate inventory counts. With this connector, you talk to your AI agent about the silo's condition just like talking to a floor manager. Your agent automatically pulls readings from multiple sensors—checking current temperatures or detecting elevated CO2 levels—and tells you if things are okay. You can also pull historical data streams to see how conditions changed over weeks. Need to fix an issue? The system lets your AI agent remotely control the aeration fans and dryers based on what the sensors report. Because this MCP is hosted in the Vinkius catalog, it connects your existing workflow from any compatible client, making complex facility management conversational.

## Tools

### set_relay_state
You can use this to remotely switch physical equipment like fans or aeration systems on or off.

### get_alarms
This tool retrieves all active and historical alerts from the system, telling you what conditions require immediate attention.

### get_co2
It provides time-stamped CO2 readings to detect early signs of spoilage or mold growth in stored grain headspace.

### get_crop_level
This fetches the current volume percentage or distance reading for a specific silo, helping you manage inventory capacity.

### get_customer_devices
It lists all monitoring devices associated with your organization ID in multi-farm setups.

### get_device_attributes
This fetches the setup details and configuration metadata for any specific sensor or device.

### get_devices
This provides a comprehensive list of all connected monitoring devices, including their type and current status.

### get_moisture
It returns the current grain moisture content percentage from a specific sensor reading.

### get_device_telemetry
It retrieves customizable, time-series data streams (like temperature or moisture) from a device over specified periods.

### get_temperature
This gets the real-time temperature reading in Celsius for any monitored silo or bin.

### get_weather
It pulls the latest local weather data, including wind speed and rainfall, for external planning.

## Prompt Examples

**Prompt:** 
```
Check the temperature and moisture in silo 3 and tell me if there is any spoilage risk.
```

**Response:** 
```
Checking silo 3 sensors... Temperature: 18.5°C (normal, safe storage range). Moisture: 13.2% (within safe limits for grain storage). CO2: 850 ppm (normal, no biological activity detected). Crop level: 72% full. Overall assessment: Grain condition is GOOD — no spoilage risk detected. Temperature is stable and well below the 25°C spoilage threshold. Moisture is below the 15% critical level. Continue routine monitoring. Next aeration check recommended in 48 hours. Would you like to see temperature trends from the past week?
```

**Prompt:** 
```
Show me all active alarms in my grain storage facility.
```

**Response:** 
```
Fetching active alarms... Found 2 active alarms. Alarm 1 (CRITICAL): Silo 7 — High Temperature Alert. Temperature reached 28.3°C at 14:32 today, exceeding the 25°C threshold. Immediate aeration recommended. Alarm 2 (WARNING): Bin 3 — Elevated CO2 detected. CO2 levels at 1650 ppm, above the 1500 ppm warning threshold. Monitor closely and consider ventilation. All other bins and silos are within normal parameters. Priority action: Activate aeration for Silo 7 immediately. Would you like me to turn on the fan for Silo 7?
```

**Prompt:** 
```
What is the current crop level inventory across all my grain bins?
```

**Response:** 
```
Checking crop levels across all bins... Silo 1: 85% full (approx. 4,250 tonnes). Silo 2: 62% full (approx. 3,100 tonnes). Silo 3: 72% full (approx. 3,600 tonnes). Silo 4: 45% full (approx. 2,250 tonnes). Silo 5: 91% full (approx. 4,550 tonnes) — approaching capacity. Silo 6: 28% full (approx. 1,400 tonnes). Silo 7: 55% full (approx. 2,750 tonnes). Total estimated inventory: 21,900 tonnes. Silo 5 is approaching maximum capacity — consider planning grain removal soon. Would you like a detailed report with moisture and temperature data for each bin?
```

## Capabilities

### Check immediate alarm status
The system instantly lists all active alerts, like high temperatures or critical moisture drops, so you know what needs fixing right now.

### Determine spoilage risk factors
It provides current CO2 and temperature readings to tell you if mold growth or biological activity is starting before other signs appear.

### Manage aeration systems remotely
You can command the AI agent to turn fans, dryers, or blowers on or off based on real-time environmental needs.

### Track silo inventory and capacity
The system reads current crop levels across all bins, giving you an accurate count of stored volume for logistics planning.

### Pull long-term environmental trends
Get time-series data for moisture or temperature spanning weeks, which is key for insurance reports and quality audits.

## Use Cases

### Handling a potential outbreak
A consultant asks, 'What's happening in Silo 4?' Your agent first calls `get_alarms` to see if anything is critical. Then it checks `get_co2` and `get_temperature`. If both are high, the agent summarizes: 'Spoilage risk detected; activate aeration immediately using `set_relay_state`.' 

### Pre-shipment inventory check
A manager needs to know total available volume. They query the system which uses `get_crop_level` for every bin and sums them up, providing a clear tonnage estimate.

### Planning natural drying cycles
Before sending grain out, the agent checks `get_weather` data to forecast rainfall or wind speed. This helps determine if outdoor air conditions are good enough for drying before manually adjusting controls using `set_relay_state`.

### Multi-site audit
An operator needs an inventory list across three different farms. They use `get_customer_devices` to pull device IDs for each site, then call `get_device_telemetry` for comparative trend analysis.

## Benefits

- Stop guessing about storage health. Instead of manual checks, use `get_alarms` to get a single list of everything that's critically wrong across all bins.
- Save time on reports. Don't manually grab data from different screens; ask your agent for historical telemetry using `get_device_telemetry` and get trend lines instantly.
- Control the environment without being there. When moisture levels rise, immediately tell your AI client to run `set_relay_state` and activate aeration systems.
- Know what you have on hand. Use `get_crop_level` to check inventory across every silo, making capacity planning a simple query instead of a dashboard drill-down.
- Be proactive about spoilage. Check for early indicators by running `get_co2` alongside `get_temperature` readings; this combination lets you catch mold issues weeks before they become visible.

## How It Works

The bottom line is this MCP turns complicated sensor data into simple conversations with your AI client.

1. First, you connect your AgroLog credentials (username, password, URL) to the MCP in Vinkius.
2. Next, you ask your AI agent a question—like 'What's wrong with Silo 5?'—and it calls the relevant tools automatically.
3. Finally, you get a plain language summary from your agent that tells you exactly what the sensors found and what action to take.

## Frequently Asked Questions

**How do I check for spoilage risk using the get_co2 tool?**
The `get_co2` tool gives current headspace gas readings. Elevated levels warn you of biological activity, indicating mold or insect respiration that is a key sign of spoilage.

**Can I check inventory using the get_crop_level tool?**
Yes, `get_crop_level` provides the current grain volume percentage for any monitored silo, which is essential data for logistics and capacity planning.

**What if I need to turn off a fan? Do I use set_relay_state?**
That's right. You use `set_relay_state` by specifying the device ID, relay name, and setting the desired state to 'false' (off).

**How do I see all my equipment locations?**
You start by calling `get_devices`. This lists every sensor, weather station, or monitor connected to your system, giving you a full inventory.

**What data can I get using the `get_device_telemetry` tool for trend analysis?**
The tool retrieves customizable, time-series sensor data. You specify keys—like temperature or moisture—and define a time range to analyze trends. This is vital for identifying subtle shifts in grain conditions over days or weeks.

**If I need calibration or sensor positioning details, how do I use `get_device_attributes`?**
This tool returns critical metadata and configuration details for any specific device ID. You can validate setup parameters, check the last calibration date, or confirm a sensor's physical placement within the silo.

**How can I use `get_customer_devices` to view inventory across multiple farms?**
It lists all monitoring equipment tied to your specific customer account or organization ID. This capability is essential when managing assets for a service provider or overseeing operations across different corporate sites.

**What information does `get_weather` provide for harvest planning?**
The tool provides the latest readings on outdoor temperature, wind speed, rainfall, and humidity. You use this environmental context to make informed decisions about natural air drying or optimal harvest timing.

**Can my AI check the current temperature and moisture in my grain silo?**
Yes! First use `get_devices` to find the device ID for your silo sensors. Then use `get_temperature` and `get_moisture` with that device ID to get current readings. Temperature above 25°C or moisture above 15% may indicate spoilage risk. For historical trends, use `get_device_telemetry` with keys=temperature,moisture to see how conditions have changed over time.

**How do I detect early signs of grain spoilage using CO2 levels?**
Use the `get_co2` tool to check CO2 readings from headspace sensors in your bins. Elevated CO2 levels (above 1500 ppm) indicate biological activity from mold, insects, or grain respiration — often appearing days before temperature changes. Combine with `get_alarms` to check for any active spoilage alerts. If CO2 is rising, consider turning on aeration using `set_relay_state` to ventilate the bin and reduce spoilage risk.

**Can I remotely control my aeration fans based on sensor readings?**
Yes! Use the `set_relay_state` tool with your device ID, relay name (e.g., "fan", "aeration"), and desired state (true for ON, false for OFF). Before activating, check current conditions with `get_temperature` and `get_moisture`, and verify weather conditions with `get_weather` to ensure outdoor conditions are suitable for aeration. For example, avoid running aeration during high humidity or rain.