services
Trefle
Overview

Trefle Service

Trefle is an open, freely accessible botanical data source and REST API. The platform exposes Trefle data via MCP tools so you can search plants and species, and fetch plant details by slug.

Overview

The Trefle service provides access to:

  • Search plants — By common or scientific name (trefle.search_plants)
  • Get plant by slug — Single plant details (trefle.get_plant)
  • Search species — By common or scientific name (trefle.search_species)
  • Get species by slug — Single species details (trefle.get_species)
  • Service metadata — Name, description, API info (trefle.metadata)

Available Tools

See the Tools Reference for complete tool documentation.

Quick Example

curl -X POST \
  -H "x-api-key: dev-key-12345" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "trefle.search_plants",
      "arguments": {
        "q": "coconut",
        "data_format": "cleaned"
      }
    }
  }' \
  http://localhost:3001/api/v1/services/trefle/mcp

Data Formats

Cleaned Format (Default)

Normalized response with a _format: "cleaned" marker. Same structure as raw for now; future versions may add a normalized plant schema.

Raw Format

Original JSON as returned by the Trefle API (opens in a new tab).

Authentication

Trefle requires a personal access token. Sign up at trefle.io (opens in a new tab), then set either TREFLE_API_KEY or TREFLE_ACCESS_TOKEN in the MCP service environment (e.g. in docker-compose.mcp.yml or .env).

Rate Limits

Trefle applies a limit of 120 requests per minute. The MCP service does not cache; each call hits the upstream API.

Data Mode

Trefle is integrated as a Modeled source: botanical data is relatively static. We call upstream live; optional batch-import or caching can be added later.