mcp / MCP_RESOURCES.md
Tracy André
updated
e55413f
|
raw
history blame
4.78 kB

MCP Resources Documentation

Overview

This MCP server provides agricultural data analysis resources for weed pressure prediction and crop recommendations. The resources are designed to be consumed by LLMs through the Model Context Protocol.

Available Resources

Static Resources

agricultural://plots

  • Description: List of all available agricultural plots
  • Returns: String with plot names and count
  • Example: "Available plots (106): Charbonnerie Entrée, Grand champ 5 (MH), ..."

agricultural://crops

  • Description: List of all crop types in the dataset
  • Returns: String with crop names and count
  • Example: "Available crops (42): blé tendre hiver, pois de conserve, ..."

agricultural://years

  • Description: Range of years available in the dataset
  • Returns: String with year range and total count
  • Example: "Available years: 2014-2025 (12 years total)"

agricultural://dataset-info

  • Description: Comprehensive dataset information
  • Returns: String with statistics about the agricultural dataset
  • Includes: Record counts, plot/crop/intervention counts, herbicide usage stats

agricultural://herbicide-usage

  • Description: Summary of herbicide usage patterns
  • Returns: String with IFT statistics and risk distribution
  • Includes: Total applications, average IFT, risk levels, most used herbicides

agricultural://predictions/2025-2027

  • Description: Summary of weed pressure predictions for 2025-2027
  • Returns: String with prediction statistics and risk distribution
  • Includes: Total predictions, average IFT, risk levels, best plots

agricultural://recommendations/sensitive-crops

  • Description: Summary of plot recommendations for sensitive crops
  • Returns: String with recommendation statistics and top plots
  • Includes: Suitable plots count, average score, top 5 recommendations

Parameterized Resources

agricultural://plot/{plot_name}

  • Description: Detailed information about a specific agricultural plot
  • Parameters: plot_name (string) - Name of the plot
  • Returns: String with plot statistics and characteristics
  • Includes: Interventions count, years active, herbicide usage, surface, main crops

agricultural://crop/{crop_type}

  • Description: Information about a specific crop type
  • Parameters: crop_type (string) - Name of the crop
  • Returns: String with crop cultivation patterns
  • Includes: Total interventions, years cultivated, plots count, herbicide usage

agricultural://year/{year}

  • Description: Summary of agricultural activities for a specific year
  • Parameters: year (int) - Year to analyze
  • Returns: String with year statistics
  • Includes: Total interventions, active plots, crop types, most active plot/crop

agricultural://plot/{plot_name}/predictions

  • Description: Weed pressure predictions for a specific plot
  • Parameters: plot_name (string) - Name of the plot
  • Returns: String with predictions for 2025-2027
  • Includes: IFT predictions by year, risk levels, historical average, recent crops

Usage Examples

For LLMs

# Get dataset overview
dataset_info = get_dataset_info()

# Get specific plot information
plot_info = get_plot_info("Champ ferme W du sol")

# Get crop cultivation patterns
crop_info = get_crop_info("blé tendre hiver")

# Get year summary
year_summary = get_year_summary(2023)

# Get herbicide usage patterns
herbicide_usage = get_herbicide_usage_summary()

# Get predictions summary
predictions = get_predictions_summary()

# Get recommendations for sensitive crops
recommendations = get_recommendations_summary()

# Get specific plot predictions
plot_predictions = get_plot_predictions("Etang 5")

Activation Instructions

To activate MCP resources, uncomment the @gr.mcp.resource decorators in mcp_server.py:

# Change from:
# @gr.mcp.resource("agricultural://plots")
def get_available_plots_resource() -> str:

# To:
@gr.mcp.resource("agricultural://plots")
def get_available_plots_resource() -> str:

Data Sources

  • Station: Station Expérimentale de Kerguéhennec
  • Period: 2014-2025
  • Records: 5,756 agricultural interventions
  • Plots: 106 agricultural plots
  • Crops: 42 different crop types
  • Herbicide Applications: 985 applications

Key Metrics

  • IFT (Indice de Fréquence de Traitement): Number of herbicide applications per hectare
  • Risk Levels:
    • Low (IFT < 1.0): Suitable for sensitive crops
    • Moderate (1.0 ≤ IFT < 2.0): Requires monitoring
    • High (IFT ≥ 2.0): Not recommended for sensitive crops
  • Recommendation Score: 100 - (predicted_ift × 30)