Trefle · Capability
Trefle API — Plants
Trefle API — Plants. 3 operations. Lead operation: List Plants. Self-contained Naftiko capability covering one Trefle business surface.
What You Can Do
GET
Listplants
— List Plants
/v1/plants
GET
Searchplants
— Search Plants
/v1/plants/search
GET
Getplant
— Get Plant
/v1/plants/{id}
MCP Tools
list-plants
List Plants
read-only
idempotent
search-plants
Search Plants
read-only
idempotent
get-plant
Get Plant
read-only
idempotent
Capability Spec
naftiko: 1.0.0-alpha2
info:
label: Trefle API — Plants
description: 'Trefle API — Plants. 3 operations. Lead operation: List Plants. Self-contained Naftiko capability covering
one Trefle business surface.'
tags:
- Trefle
- Plants
created: '2026-05-19'
modified: '2026-05-19'
binds:
- namespace: env
keys:
TREFLE_API_KEY: TREFLE_API_KEY
capability:
consumes:
- type: http
namespace: trefle-plants
baseUri: https://trefle.io/api/v1
description: Trefle API — Plants business capability. Self-contained, no shared references.
resources:
- name: plants
path: /plants
operations:
- name: listplants
method: GET
description: List Plants
outputRawFormat: json
outputParameters:
- name: result
type: object
value: $.
inputParameters:
- name: page
in: query
type: integer
description: Page number for pagination
- name: filter[common_name]
in: query
type: string
description: Filter plants by common name (partial match supported)
- name: filter[slug]
in: query
type: string
description: Filter plants by slug
- name: filter_not[common_name]
in: query
type: string
description: Exclude plants matching this common name
- name: order[common_name]
in: query
type: string
description: Order results by common name
- name: order[scientific_name]
in: query
type: string
description: Order results by scientific name
- name: plants-search
path: /plants/search
operations:
- name: searchplants
method: GET
description: Search Plants
outputRawFormat: json
outputParameters:
- name: result
type: object
value: $.
inputParameters:
- name: q
in: query
type: string
description: Search query — common name or scientific name
required: true
- name: page
in: query
type: integer
description: Page number for pagination
- name: plants-id
path: /plants/{id}
operations:
- name: getplant
method: GET
description: Get Plant
outputRawFormat: json
outputParameters:
- name: result
type: object
value: $.
inputParameters:
- name: id
in: path
type: string
description: The plant's Trefle ID or slug
required: true
authentication:
type: apikey
key: token
value: '{{env.TREFLE_API_KEY}}'
placement: query
exposes:
- type: rest
namespace: trefle-plants-rest
port: 8080
description: REST adapter for Trefle API — Plants. One Spectral-compliant resource per consumed operation, prefixed with
/v1.
resources:
- path: /v1/plants
name: plants
description: REST surface for plants.
operations:
- method: GET
name: listplants
description: List Plants
call: trefle-plants.listplants
with:
page: rest.page
filter[common_name]: rest.filter[common_name]
filter[slug]: rest.filter[slug]
filter_not[common_name]: rest.filter_not[common_name]
order[common_name]: rest.order[common_name]
order[scientific_name]: rest.order[scientific_name]
outputParameters:
- type: object
mapping: $.
- path: /v1/plants/search
name: plants-search
description: REST surface for plants-search.
operations:
- method: GET
name: searchplants
description: Search Plants
call: trefle-plants.searchplants
with:
q: rest.q
page: rest.page
outputParameters:
- type: object
mapping: $.
- path: /v1/plants/{id}
name: plants-id
description: REST surface for plants-id.
operations:
- method: GET
name: getplant
description: Get Plant
call: trefle-plants.getplant
with:
id: rest.id
outputParameters:
- type: object
mapping: $.
- type: mcp
namespace: trefle-plants-mcp
port: 9090
transport: http
description: MCP adapter for Trefle API — Plants. One tool per consumed operation, routed inline through this capability's
consumes block.
tools:
- name: list-plants
description: List Plants
hints:
readOnly: true
destructive: false
idempotent: true
call: trefle-plants.listplants
with:
page: tools.page
filter[common_name]: tools.filter[common_name]
filter[slug]: tools.filter[slug]
filter_not[common_name]: tools.filter_not[common_name]
order[common_name]: tools.order[common_name]
order[scientific_name]: tools.order[scientific_name]
outputParameters:
- type: object
mapping: $.
- name: search-plants
description: Search Plants
hints:
readOnly: true
destructive: false
idempotent: true
call: trefle-plants.searchplants
with:
q: tools.q
page: tools.page
outputParameters:
- type: object
mapping: $.
- name: get-plant
description: Get Plant
hints:
readOnly: true
destructive: false
idempotent: true
call: trefle-plants.getplant
with:
id: tools.id
outputParameters:
- type: object
mapping: $.