Government Org-Chart Card #7
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:15Z - https://github.com/coilysiren/eco-mcp-app/issues/18
Task 9 — Government Org-Chart Card
Prereq: read
todo/README.mdfirst.Goal
Build an MCP tool
get_eco_governmentrendering a card showing the server's civic structure.Data sources (all public, no auth)
GET http://eco.coilysiren.me:3001/api/v1/elections/titles— list of titles with occupants, grouped by settlement/state.GET http://eco.coilysiren.me:3001/api/v1/elections— active and inactive elections. Verified empty[]on Day 3. Code must handle this gracefully.GET http://eco.coilysiren.me:3001/api/v1/laws?byStates=Active— active laws (40 KB on current cycle).Titles shape — verify before committing schema
Each title entry has the form
{"Table": [[row, ...], ...]}. There's no top-levelOccupantfield; the occupant (and things like "Election Process", "Eligible Candidates") are rows insideTablewith a key/description/value triple. Before designing the mermaid/graphviz graph, print one full title entry and confirm which row label holds the occupant's name — it's likely a row whose label contains "Occupant" or "Current" or "Holder", but verify live before coding.Rendered card
"Steamtide Cay Foundation").ends-in-N-hourscountdown. If/api/v1/electionsis empty, render a "No active elections" placeholder — don't drop the section.Law markup sanitizer
Laws contain Eco markup tokens like:
<link="view:283:-1">...</link><icon name="Claim" type="">...</icon><color=#abcdef>...</color><style="Positive">...</style>Strip with one regex:
re.sub(r"</?(link|icon|color|style)(\s[^>]*)?>", "", s). Do not attempt to render the inline icons — just remove them. Leave surrounding text intact.Implementation notes
src/eco_mcp_app/server.py.src/eco_mcp_app/templates/partials/.Acceptance
inv smokepasses.