Biodiversity Drift + Ecoregion Match #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally filed by @coilysiren on 2026-05-02T23:10:19Z - https://github.com/coilysiren/eco-mcp-app/issues/19
Task 10 — Biodiversity Drift + Ecoregion Match
Prereq: read
todo/README.mdfirst.Goal
Build an MCP tool
get_eco_ecoregionrendering a card that:Data sources
Public:
GET http://eco.coilysiren.me:3001/api/v1/worldlayers/layers— list of 7 top-level categories. Each entry:{Category, List: [{LayerName, LayerDisplayName, Summary, Tooltip, Category, DisplayRow}]}."Biome"and"Animal". Check the other category strings before assuming"Plant Group"is one of them — pull the distinctCategoryvalues from the response first.TaigaBiome,DesertBiome,WetlandBiome,ColdForestBiome,ForestBiome,WarmForestBiome,TundraBiome,DeepOceanBiome,OceanBiome,GrasslandBiome,RainforestBiome,IceBiome— 12 total.Summaryis a string like"4%". Parse withfloat(re.match(r"(\d+(?:\.\d+)?)", summary).group(1)).Admin (header
X-API-Keyfrom SSM/eco-mcp-app/api-admin-token, regionus-east-1):GET /api/v1/exporter/specieslist— newline-delimited plain text, NOT JSON. Parseresp.text.splitlines().GET /api/v1/exporter/species?speciesName=X— CSV"Time","Value".Timeis seconds since cycle start (600 s cadence).Static, committed in-repo:
data/ecoregions.json(don't fetch at runtime). Source candidates:https://ecoregions.appspot.com/(manual download) or WWF's Terrestrial Ecoregions of the World publication. Shape:[{name, biome_vector: {TaigaBiome: 0.0, DesertBiome: 0.15, ...}, description}, ...].IMPORTANT: biome percentages do NOT sum to 100
In live data (verified today):
The summaries are % of world area, but large chunks of the world (mountains, shallow water, transitional zones) don't fall into any named biome. Normalize the vector to
sum=1.0before doing cosine similarity with the WWF vectors. Do not assert on raw-sum >= 95%.Card layout
sim(a, b) = dot(a, b) / (norm(a) * norm(b)).(latest − first) / firstdelta.Dead-end (do not attempt)
Rendering world biomes as spatial tiles. The per-layer endpoint only returns summary text, no grid pixels — verified dead in a prior spike. This tool works from percentages only.
Implementation notes
worldlayers/layersresponse for 5 minutes — biome percentages don't change minute-to-minute.Acceptance
boomandbustlists; on Day 3 both lists may have near-zero deltas — render "drift minimal so far" as a placeholder in that case.ecoregions.json.inv smokepasses.