feat: add OpenHerbarium MCP server core
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
from urllib.parse import quote_plus
|
||||
|
||||
from .models import evidence, utc_now_iso
|
||||
|
||||
RHS_SOURCE = "Royal Horticultural Society"
|
||||
|
||||
CARE_TOPICS = ["light", "temperature", "humidity", "watering", "substrate", "fertilisation", "repotting"]
|
||||
|
||||
|
||||
def rhs_care_source_candidates(name: str) -> dict[str, Any]:
|
||||
"""Return RHS search/source candidates without turning them into care recommendations."""
|
||||
query = quote_plus(name)
|
||||
base_url = f"https://www.rhs.org.uk/search?query={query}"
|
||||
return {
|
||||
"status": "source_candidates",
|
||||
"source": RHS_SOURCE,
|
||||
"retrieved_at": utc_now_iso(),
|
||||
"records": [
|
||||
{
|
||||
"topic": topic,
|
||||
"value": evidence(
|
||||
f"RHS search candidate for {topic}; fetch and verify before use.",
|
||||
source=RHS_SOURCE,
|
||||
url=base_url,
|
||||
confidence="low",
|
||||
),
|
||||
}
|
||||
for topic in CARE_TOPICS
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user