Wikidata Ecopedia #10
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:02Z - https://github.com/coilysiren/eco-mcp-app/issues/15
Task 6 — Wikidata Ecopedia
Prereq: read
todo/README.mdfirst.Goal
Build an MCP tool
explain_eco_item(name, category?)rendering a card about any Eco item using Wikidata + Wikipedia.Flow
categoryis optional; it disambiguates the SPARQL query. Example:name="Iron",category="material"filters to Q677 (chemical element) rather than mythological figures named Iron.https://query.wikidata.org/sparqlfor the item's Wikidata entity; extract:material(elements): atomic number P1086plant: taxon rank P105animal: taxon rank P105, conservation status P141mineral: Mohs hardness P1088food: main food source P186GET https://en.wikipedia.org/api/rest_v1/page/summary/{name}for a short text summary when SPARQL yields nothing usable.Required request headers (both Wikidata and Wikipedia)
Caching
~/.cache/eco-mcp-app/wikidata.sqlite.Default category
If no
categoryprovided: try Wikipedia REST/page/summary/{name}first (cheap, always returns something or 404). Only hit SPARQL when that fails or returns an ambiguous disambiguation page.Categories to support
materialplantanimalmineralfoodImplementation notes
data:URI (CSP).src/eco_mcp_app/server.py.src/eco_mcp_app/templates/partials/.Acceptance
["Iron", "Oak", "Bison", "Wheat", "Quartz"]and returns a card with image + description + facts for each.~/.cache/eco-mcp-app/wikidata.sqliteexists and contains rows).inv smokepasses.