# OpenFarm Agriculture MCP

> OpenFarm Agriculture connects your AI agent to a massive database of farming and gardening data. You can search for crops by name, get detailed technical specs (like optimal spacing or sun needs), list available growing guides, and pull specific instructions from a guide ID. It's pure, crowdsourced plant knowledge.

## Overview
- **Category:** knowledge-management
- **Price:** Free
- **Tags:** crops, gardening, growing-guides, botany, crowdsourced-data

## Description

OpenFarm Agriculture connects your AI agent directly to a massive, open-source database covering thousands of plant species and gardening techniques. You get pure, crowdsourced knowledge that lets you skip the guesswork when planning a garden or running an agricultural project.

Need to know about a specific crop? Start by using `search_crops` to look up any plant by its common name. This function pulls back enough info—like scientific IDs and basic descriptions—so your agent knows exactly what it's working with. Once you have that ID, you can run `get_crop_details`. This tool retrieves the deep technical specs for a specific crop, giving you hard data like optimal sun requirements, ideal sowing methods, and recommended spacing measurements. It’s pure mechanical info, perfect for planning layout or understanding environmental needs.

If you're trying to find out how to grow something, `list_growing_guides` is your go-to. You can search the entire database for available growth guides, even narrowing that search down by a specific crop name to cut through the noise. When you pinpoint the right guide, use `get_guide_details`. This function pulls in the complete, step-by-step care instructions—the whole deal. It gives you detailed planting and maintenance advice using an exact guide ID. You'll get everything from initial soil prep to harvest tips.

This server isn't proprietary; it’s a giant knowledge pool built by gardeners everywhere. Your AI client uses these tools to give you the actionable data points you need: first, `search_crops` gives you the basic IDs and names for any plant you wanna track. Next, if you want hard science on that crop—like how much sun it needs or what spacing works best—you run `get_crop_details`. Then, to find out *how* to actually grow it, you use `list_growing_guides`, which lets you scope the search down by a specific plant name. Finally, once you've got the right guide listed, `get_guide_details` pulls every single step into one place: planting instructions, care routines, and what to do when things go sideways. You don't need guesswork; you just use these tools.

## Tools

### get_species_details
Critical for precision agriculture and biodiversity assessments.

Get detailed taxonomic and growing data for a specific species

### list_species
Each species includes taxonomic classification, growth form, and habitat data. Use without a query to browse, or with a query to search.

Search for plant species, optionally filtered by name

### search_crops
Looks up plants in the database using a common name to get their IDs and basic descriptions.

### get_crop_details
Retrieves technical data, including sun requirements and sowing methods, using a specific crop ID.

## Prompt Examples

**Prompt:** 
```
How do I grow tomatoes according to OpenFarm?
```

**Response:** 
```
Searching OpenFarm for 'Tomato'... I found several guides. Common requirements include full sun, well-drained soil, and a sowing depth of about 0.5 inches. Would you like a detailed guide?
```

## Capabilities

### Search for Crops
Find plants in the database by name to retrieve scientific IDs and basic descriptions.

### Retrieve Crop Details
Get detailed technical data—like sun needs, sowing methods, and spacing—for a specific crop ID.

### List Available Guides
Search the database for growing guides, filtering results by a particular crop name.

### Get Guide Instructions
Fetch detailed, step-by-step care and planting instructions using an exact guide ID.

## Use Cases

### Planning a New Garden Bed
A user needs to plant tomatoes and peppers. They first call `search_crops` for both names. Then, they use the resulting IDs in `get_crop_details` to compare sun requirements and optimal spacing side-by-side before buying seeds.

### Troubleshooting a Specific Plant
A gardener has an issue with zucchini growth. Instead of searching forums, they call `search_crops` for 'zucchini', get the ID, and then use that ID to run `get_guide_details`. The agent pulls the exact step-by-step instructions needed.

### Creating a Plant Database Schema
A researcher needs a list of all possible guides for beans. They call `list_growing_guides` and filter by 'bean'. This returns guide IDs, which the agent can then pass to `get_guide_details` to structure a full database dump.

### Comparing Cultivation Methods
A user wants to compare growing methods for two different crops. They use `search_crops` on both, get the IDs, and then run `get_crop_details` multiple times to gather all comparative technical data points.

## Benefits

- Stop guessing on planting conditions. Use `get_crop_details` to instantly pull technical specs like optimal spacing and required sun hours for any crop ID.
- Build complex plans faster. You can run a sequence: `search_crops` -> `list_growing_guides` -> `get_guide_details`, all in one chat session.
- Cut through the noise of forum advice. The data you get back from OpenFarm is structured, sourced, and reliable for serious farming or gardening projects.
- No more manual lookups. When planning a garden, your agent handles the lookup process: finding the crop ID first, then pulling all necessary instructions.
- Handles diverse needs. Whether you're checking basic care tips (`search_crops`) or running an intensive research query (`get_crop_details`), this server covers it.

## How It Works

The bottom line is you treat it like a tiered lookup: search general data first, then drill down into specifics using IDs for precision.

1. Start by calling `search_crops` with the common name of a plant (e.g., 'tomato').
2. Use the returned crop ID to call `get_crop_details` for technical specs, or use the results to list guides via `list_growing_guides`.
3. Finally, pass a specific guide ID to `get_guide_details` to get the full set of instructions.

## Frequently Asked Questions

**How do I start with OpenFarm Agriculture and find a plant ID?**
Start by calling `search_crops` with the common name of the plant (e.g., 'corn'). The output will provide the necessary scientific name and, more importantly, the unique ID you need for other tools.

**Do I need an API key to use get_crop_details?**
No. This server is designed for public data access, so you don't need to manage any API keys or credentials when calling `get_crop_details`.

**What if I want a guide for a crop but don't know the ID?**
First, use `list_growing_guides`. You can filter this search by the crop name to narrow down available guides before attempting to retrieve details.

**Can I compare multiple crops using OpenFarm Agriculture MCP Server?**
Yes. Use `search_crops` for all your plants, gather their IDs, and then run `get_crop_details` sequentially for each one to build a comparison matrix.

**What happens if I use get_crop_details with an invalid or deprecated ID?**
The tool returns a specific error code and null data. You'll need to verify the crop ID against our documentation or try using the search_crops function first. This ensures you have the most current, active identifier for the plant.

**How can I narrow down results when I use list_growing_guides?**
You filter guides by passing a crop ID as an optional parameter to the tool call. Instead of seeing every guide in the database, you get instructions specific to the plant you're interested in.

**Are there rate limits when I run many searches with search_crops?**
Yes, there are usage quotas designed to prevent overloading the system. If you submit too many requests in a short time, your agent will receive an appropriate rate-limit error. We recommend pacing multiple calls.

**Does OpenFarm Agriculture cover ornamental plants or just edible crops?**
The database includes both ornamental and edible species data. When you run search_crops, the results provide scientific names and general care instructions regardless of whether the plant is for cooking or purely decorative.

**Is an API Key required for OpenFarm?**
No, this integration accesses the public OpenFarm API which does not require authentication for reading crop and guide data.