@webmcp-auto-ui/agent 2.5.8 → 2.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/autoui-server.ts +134 -134
- package/src/diagnostics.ts +3 -3
- package/src/loop.ts +6 -6
- package/src/providers/wasm.ts +5 -5
- package/src/recipes/_generated.ts +446 -446
- package/src/recipes/afficher-oeuvres-art-collection-musee.md +45 -45
- package/src/recipes/analyser-actualites-hacker-news.md +52 -52
- package/src/recipes/cartographier-observations-biodiversite.md +44 -44
- package/src/recipes/cross-server.md +48 -48
- package/src/recipes/dashboard-kpi.md +45 -45
- package/src/recipes/explorer-dossiers-legislatifs-parcours-texte.md +48 -48
- package/src/recipes/gallery-images.md +33 -33
- package/src/recipes/parlementaire-profile.md +58 -58
- package/src/recipes/rechercher-textes-juridiques-legifrance.md +38 -38
- package/src/recipes/weather-viz.md +35 -35
- package/src/recipes/widgets/actions.md +6 -6
- package/src/recipes/widgets/alert.md +6 -6
- package/src/recipes/widgets/cards.md +10 -10
- package/src/recipes/widgets/carousel.md +8 -8
- package/src/recipes/widgets/chart-rich.md +10 -10
- package/src/recipes/widgets/chart.md +9 -9
- package/src/recipes/widgets/code.md +6 -6
- package/src/recipes/widgets/d3.md +10 -10
- package/src/recipes/widgets/data-table.md +10 -10
- package/src/recipes/widgets/gallery.md +10 -10
- package/src/recipes/widgets/grid-data.md +11 -11
- package/src/recipes/widgets/hemicycle.md +9 -9
- package/src/recipes/widgets/js-sandbox.md +10 -10
- package/src/recipes/widgets/json-viewer.md +8 -8
- package/src/recipes/widgets/kv.md +9 -9
- package/src/recipes/widgets/list.md +7 -7
- package/src/recipes/widgets/log.md +6 -6
- package/src/recipes/widgets/map.md +10 -10
- package/src/recipes/widgets/profile.md +9 -9
- package/src/recipes/widgets/recipe-browser.md +33 -33
- package/src/recipes/widgets/sankey.md +10 -10
- package/src/recipes/widgets/stat-card.md +7 -7
- package/src/recipes/widgets/stat.md +10 -10
- package/src/recipes/widgets/tags.md +6 -6
- package/src/recipes/widgets/text.md +6 -6
- package/src/recipes/widgets/timeline.md +6 -6
- package/src/recipes/widgets/trombinoscope.md +8 -8
- package/src/summarize.ts +6 -6
- package/src/tool-layers.ts +26 -26
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
---
|
|
2
|
-
id:
|
|
3
|
-
name:
|
|
2
|
+
id: display-parliamentary-profile-with-hemicycle-and-votes
|
|
3
|
+
name: Display a parliamentary profile with hemicycle, votes and mandate timeline
|
|
4
4
|
components_used: [profile, hemicycle, timeline, table, stat-card, kv]
|
|
5
|
-
when:
|
|
5
|
+
when: MCP data concerns a deputy, senator, parliamentary group, vote, or amendment from a parliamentary database
|
|
6
6
|
servers: [tricoteuses]
|
|
7
7
|
layout:
|
|
8
8
|
type: grid
|
|
9
9
|
columns: 2
|
|
10
|
-
arrangement: profile + stats
|
|
10
|
+
arrangement: profile + stats at top, hemicycle + timeline below
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## When to use
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
15
|
+
MCP results come from the Tricoteuses server (French parliamentary database) and concern:
|
|
16
|
+
- A **deputy or senator**: individual profile, mandates, activity
|
|
17
|
+
- A **political group**: composition, votes, positioning
|
|
18
|
+
- **Public votes**: vote results, breakdown by group
|
|
19
|
+
- **Amendments**: text, author, outcome, targeted article
|
|
20
|
+
- **Legislative files**: text journey, parliamentary shuttle
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
This recipe is specific to the Tricoteuses server and its tools: `query_sql`, `search_recipes`, `list_tables`, `describe_table`.
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## How to use
|
|
25
25
|
|
|
26
|
-
1. **
|
|
26
|
+
1. **Retrieve the parliamentary member's information** via the Tricoteuses tools:
|
|
27
27
|
```
|
|
28
28
|
query_sql({sql: "SELECT * FROM acteurs WHERE nom ILIKE '%dupont%' AND type = 'depute'"})
|
|
29
29
|
```
|
|
30
|
-
|
|
30
|
+
Or via Tricoteuses recipes:
|
|
31
31
|
```
|
|
32
32
|
search_recipes({query: "profil depute"})
|
|
33
33
|
get_recipe({name: "recipe-name"})
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
2. **
|
|
36
|
+
2. **Display the profile card**:
|
|
37
37
|
```
|
|
38
38
|
component("profile", {
|
|
39
39
|
name: "Jean Dupont",
|
|
@@ -43,15 +43,15 @@ La recette est specifique au serveur Tricoteuses et a ses outils : `query_sql`,
|
|
|
43
43
|
})
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
3. **
|
|
46
|
+
3. **Display activity statistics** in stat-cards:
|
|
47
47
|
```
|
|
48
|
-
component("stat-card", {label: "
|
|
49
|
-
component("stat-card", {label: "
|
|
50
|
-
component("stat-card", {label: "
|
|
51
|
-
component("stat-card", {label: "
|
|
48
|
+
component("stat-card", {label: "Vote participation", value: "87%", trend: "+3%", trendDir: "up"})
|
|
49
|
+
component("stat-card", {label: "Amendments filed", value: "42", icon: "file-text"})
|
|
50
|
+
component("stat-card", {label: "Written questions", value: "18", icon: "help-circle"})
|
|
51
|
+
component("stat-card", {label: "Hemicycle speeches", value: "7", icon: "mic"})
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
4. **
|
|
54
|
+
4. **If vote data by group is available**, display the hemicycle:
|
|
55
55
|
```
|
|
56
56
|
component("hemicycle", {
|
|
57
57
|
groups: [
|
|
@@ -63,82 +63,82 @@ La recette est specifique au serveur Tricoteuses et a ses outils : `query_sql`,
|
|
|
63
63
|
})
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
5. **
|
|
66
|
+
5. **For the mandate history or key votes**, use the timeline:
|
|
67
67
|
```
|
|
68
68
|
component("timeline", {
|
|
69
69
|
events: [
|
|
70
|
-
{date: "2022-06-19", title: "
|
|
71
|
-
{date: "2023-03-16", title: "Vote 49.3
|
|
72
|
-
{date: "2024-07-07", title: "
|
|
70
|
+
{date: "2022-06-19", title: "Elected deputy", description: "3e circ. du Rhone"},
|
|
71
|
+
{date: "2023-03-16", title: "Vote 49.3 pensions reform", description: "Motion de censure rejetee"},
|
|
72
|
+
{date: "2024-07-07", title: "Re-elected deputy", description: "2nd round"}
|
|
73
73
|
]
|
|
74
74
|
})
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
6. **
|
|
77
|
+
6. **For vote or amendment details**, use a table:
|
|
78
78
|
```
|
|
79
79
|
component("table", {
|
|
80
|
-
columns: ["Date", "
|
|
80
|
+
columns: ["Date", "Vote", "Position", "Result"],
|
|
81
81
|
rows: votes.map(v => [v.date, v.intitule, v.position, v.resultat])
|
|
82
82
|
})
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
7. **
|
|
85
|
+
7. **Complete with metadata** in kv:
|
|
86
86
|
```
|
|
87
87
|
component("kv", {pairs: [
|
|
88
88
|
["Legislature", "XVIe (2022-2027)"],
|
|
89
|
-
["
|
|
90
|
-
["
|
|
89
|
+
["Group", "Renaissance"],
|
|
90
|
+
["Standing committee", "Lois"],
|
|
91
91
|
["Source", "Tricoteuses — mcp.code4code.eu"]
|
|
92
92
|
]})
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
##
|
|
95
|
+
## Examples
|
|
96
96
|
|
|
97
|
-
###
|
|
97
|
+
### Complete deputy profile
|
|
98
98
|
```
|
|
99
|
-
// 1.
|
|
99
|
+
// 1. Look up the deputy
|
|
100
100
|
query_sql({sql: "SELECT * FROM acteurs WHERE nom ILIKE '%dupont%' LIMIT 1"})
|
|
101
101
|
|
|
102
|
-
// 2.
|
|
102
|
+
// 2. Their amendments
|
|
103
103
|
query_sql({sql: "SELECT COUNT(*) as total, SUM(CASE WHEN sort='Adopte' THEN 1 ELSE 0 END) as adoptes FROM amendements WHERE auteur_id = $id"})
|
|
104
104
|
|
|
105
|
-
// 3.
|
|
105
|
+
// 3. Their recent votes
|
|
106
106
|
query_sql({sql: "SELECT s.date, s.intitule, v.position FROM scrutins s JOIN votes v ON s.id = v.scrutin_id WHERE v.acteur_id = $id ORDER BY s.date DESC LIMIT 10"})
|
|
107
107
|
|
|
108
|
-
// 4.
|
|
108
|
+
// 4. Full render
|
|
109
109
|
component("profile", {name, subtitle, photo})
|
|
110
|
-
component("stat-card", {label: "
|
|
111
|
-
component("stat-card", {label: "
|
|
112
|
-
component("stat-card", {label: "
|
|
113
|
-
component("table", {columns: ["Date", "
|
|
110
|
+
component("stat-card", {label: "Amendments", value: total, icon: "file-text"})
|
|
111
|
+
component("stat-card", {label: "Adopted", value: adoptes, icon: "check"})
|
|
112
|
+
component("stat-card", {label: "Adoption rate", value: Math.round(adoptes/total*100) + "%"})
|
|
113
|
+
component("table", {columns: ["Date", "Vote", "Position"], rows: votes})
|
|
114
114
|
component("timeline", {events: mandats})
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
###
|
|
117
|
+
### Vote result with hemicycle
|
|
118
118
|
```
|
|
119
|
-
// 1.
|
|
119
|
+
// 1. Retrieve the vote
|
|
120
120
|
query_sql({sql: "SELECT * FROM scrutins WHERE intitule ILIKE '%budget%' ORDER BY date DESC LIMIT 1"})
|
|
121
121
|
|
|
122
|
-
// 2.
|
|
122
|
+
// 2. Breakdown by group
|
|
123
123
|
query_sql({sql: "SELECT g.nom, g.couleur, COUNT(*) FILTER (WHERE v.position='pour') as pour, COUNT(*) FILTER (WHERE v.position='contre') as contre FROM votes v JOIN groupes g ON v.groupe_id = g.id WHERE v.scrutin_id = $id GROUP BY g.nom, g.couleur"})
|
|
124
124
|
|
|
125
|
-
// 3.
|
|
126
|
-
component("stat-card", {label: "
|
|
127
|
-
component("stat-card", {label: "
|
|
125
|
+
// 3. Render
|
|
126
|
+
component("stat-card", {label: "For", value: "312", trendDir: "up"})
|
|
127
|
+
component("stat-card", {label: "Against", value: "245", trendDir: "down"})
|
|
128
128
|
component("hemicycle", {groups: groupResults, result: {pour: 312, contre: 245, abstention: 18}})
|
|
129
|
-
component("table", {columns: ["
|
|
129
|
+
component("table", {columns: ["Group", "For", "Against", "Abstention"], rows: groupDetails})
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
##
|
|
132
|
+
## Components specific to the parliamentary domain
|
|
133
133
|
|
|
134
|
-
- **hemicycle
|
|
135
|
-
- **profile
|
|
136
|
-
- **timeline
|
|
137
|
-
- **trombinoscope
|
|
134
|
+
- **hemicycle**: semicircular arc showing vote distribution by political group, with party colors
|
|
135
|
+
- **profile**: individual card with photo, name, role, structured details
|
|
136
|
+
- **timeline**: chronology of mandates, key votes, parliamentary events
|
|
137
|
+
- **trombinoscope**: photo grid for a group of parliamentary members (useful for committees)
|
|
138
138
|
|
|
139
|
-
##
|
|
139
|
+
## Common mistakes
|
|
140
140
|
|
|
141
|
-
- **
|
|
142
|
-
- **
|
|
143
|
-
- **
|
|
144
|
-
- **Hemicycle
|
|
141
|
+
- **Overly broad SQL queries**: always use LIMIT and precise filters to avoid overloading the server
|
|
142
|
+
- **Confusing actors and mandates**: a deputy can have multiple mandates in the database — filter by current legislature
|
|
143
|
+
- **Forgetting the source**: always credit "Tricoteuses" as the source in a final kv
|
|
144
|
+
- **Hemicycle without context**: always accompany the hemicycle component with stat-cards showing for/against/abstention totals
|
|
@@ -1,85 +1,85 @@
|
|
|
1
1
|
---
|
|
2
|
-
id:
|
|
3
|
-
name:
|
|
2
|
+
id: search-legal-texts-legifrance
|
|
3
|
+
name: Search legal texts, codes and laws via Legifrance data
|
|
4
4
|
components_used: [table, text, kv, code]
|
|
5
|
-
when:
|
|
5
|
+
when: the user asks for information about French laws, legal codes, articles of law, decrees, ordinances or legislative texts available in the Tricoteuses database
|
|
6
6
|
servers: [tricoteuses]
|
|
7
7
|
layout:
|
|
8
8
|
type: grid
|
|
9
9
|
columns: 1
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## When to use
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
- "
|
|
16
|
-
- "
|
|
17
|
-
- "
|
|
18
|
-
- "
|
|
14
|
+
The user asks a question about French law, legislation, or a specific legal text:
|
|
15
|
+
- "What does article 49-3 of the Constitution say?"
|
|
16
|
+
- "Which decrees were published on labour law in 2025?"
|
|
17
|
+
- "Show me the articles of the Civil Code on filiation"
|
|
18
|
+
- "Which laws were enacted this month?"
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
The Tricoteuses database contains data from Legifrance (consolidated texts, codes, laws, decrees). Use `list_tables` to discover the available tables in the legifrance schema, then `describe_table` and `query_sql` to extract the texts.
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## How to use
|
|
23
23
|
|
|
24
|
-
1. **
|
|
24
|
+
1. **Discover available tables**:
|
|
25
25
|
```
|
|
26
26
|
list_tables({schema: "legifrance"})
|
|
27
27
|
```
|
|
28
|
-
|
|
28
|
+
Typical tables: `textes_versions`, `articles`, `codes`, `sections`
|
|
29
29
|
|
|
30
|
-
2. **
|
|
30
|
+
2. **Describe the structure** of a table to understand the columns:
|
|
31
31
|
```
|
|
32
32
|
describe_table({schema: "legifrance", table: "articles"})
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
3. **
|
|
35
|
+
3. **Search for texts** with SQL queries:
|
|
36
36
|
```
|
|
37
37
|
query_sql({sql: "SELECT titre, date_publi, nature FROM legifrance.textes_versions WHERE titre ILIKE '%travail%' ORDER BY date_publi DESC LIMIT 20"})
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
4. **
|
|
41
|
-
- **Table**
|
|
40
|
+
4. **Display results**:
|
|
41
|
+
- **Table** for lists of texts:
|
|
42
42
|
```
|
|
43
|
-
component("table", {columns: ["
|
|
43
|
+
component("table", {columns: ["Title", "Nature", "Date", "Status"], rows: textes})
|
|
44
44
|
```
|
|
45
|
-
- **Text**
|
|
45
|
+
- **Text** for the content of an article:
|
|
46
46
|
```
|
|
47
47
|
component("text", {content: "### Article 49-3 de la Constitution\n\n" + article.contenu})
|
|
48
48
|
```
|
|
49
|
-
- **Code**
|
|
49
|
+
- **Code** for legislative excerpts with formatting:
|
|
50
50
|
```
|
|
51
51
|
component("code", {language: "text", content: article.texte_integral})
|
|
52
52
|
```
|
|
53
|
-
- **KV**
|
|
53
|
+
- **KV** for text metadata:
|
|
54
54
|
```
|
|
55
|
-
component("kv", {pairs: [["Nature", "Loi organique"], ["Date", "2023-04-14"], ["NOR", "JUSX2300001L"], ["
|
|
55
|
+
component("kv", {pairs: [["Nature", "Loi organique"], ["Date", "2023-04-14"], ["NOR", "JUSX2300001L"], ["Status", "En vigueur"]]})
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
##
|
|
58
|
+
## Examples
|
|
59
59
|
|
|
60
|
-
### Articles
|
|
60
|
+
### Articles from a legal code
|
|
61
61
|
```
|
|
62
|
-
// 1.
|
|
62
|
+
// 1. Find articles of the Civil Code on filiation
|
|
63
63
|
query_sql({sql: "SELECT num_article, contenu, etat FROM legifrance.articles WHERE code = 'Code civil' AND section ILIKE '%filiation%' ORDER BY num_article"})
|
|
64
64
|
|
|
65
|
-
// 2.
|
|
66
|
-
component("kv", {pairs: [["Code", "Code civil"], ["Section", "De la filiation"], ["Articles
|
|
67
|
-
component("table", {columns: ["Article", "
|
|
65
|
+
// 2. Render
|
|
66
|
+
component("kv", {pairs: [["Code", "Code civil"], ["Section", "De la filiation"], ["Articles found", results.length]]})
|
|
67
|
+
component("table", {columns: ["Article", "Content (excerpt)", "Status"], rows: results.map(r => [r.num_article, r.contenu.slice(0, 200) + "...", r.etat])})
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
###
|
|
70
|
+
### Recent texts by nature
|
|
71
71
|
```
|
|
72
|
-
// 1.
|
|
72
|
+
// 1. Laws enacted in 2026
|
|
73
73
|
query_sql({sql: "SELECT titre, date_publi, nor FROM legifrance.textes_versions WHERE nature = 'LOI' AND date_publi >= '2026-01-01' ORDER BY date_publi DESC"})
|
|
74
74
|
|
|
75
|
-
// 2.
|
|
76
|
-
component("stat-card", {label: "
|
|
77
|
-
component("table", {columns: ["
|
|
75
|
+
// 2. Render
|
|
76
|
+
component("stat-card", {label: "Laws enacted in 2026", value: results.length, icon: "scale"})
|
|
77
|
+
component("table", {columns: ["Title", "Date", "NOR"], rows: results})
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
##
|
|
80
|
+
## Common mistakes
|
|
81
81
|
|
|
82
|
-
- **
|
|
83
|
-
- **
|
|
84
|
-
- **
|
|
85
|
-
- **
|
|
82
|
+
- **Confusing schemas**: Legifrance data is in the `legifrance` schema, not in `assemblee` — verify with `list_tables`
|
|
83
|
+
- **Overly broad queries**: always use LIMIT and precise WHERE filters
|
|
84
|
+
- **Displaying raw full text**: use the `text` component with Markdown formatting rather than dumping the JSON
|
|
85
|
+
- **Forgetting to specify the text status**: an article can be repealed, amended or in force — always indicate it
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
---
|
|
2
|
-
id:
|
|
3
|
-
name:
|
|
2
|
+
id: visualize-weather-forecasts-with-charts-and-kpis
|
|
3
|
+
name: Visualize weather forecasts with time series charts and key indicators
|
|
4
4
|
components_used: [stat-card, chart-rich, map, kv]
|
|
5
|
-
when:
|
|
5
|
+
when: MCP data contains weather measurements (temperature, humidity, wind, precipitation) or hourly/daily forecasts
|
|
6
6
|
servers: [openmeteo]
|
|
7
7
|
layout:
|
|
8
8
|
type: grid
|
|
9
9
|
columns: 2
|
|
10
|
-
arrangement: stat-cards
|
|
10
|
+
arrangement: stat-cards at the top, chart spanning full width at the bottom
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## When to use
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
- **Open-Meteo
|
|
17
|
-
-
|
|
15
|
+
MCP results contain structured weather data. Typically:
|
|
16
|
+
- **Open-Meteo**: hourly forecasts (`hourly.temperature_2m`, `hourly.precipitation`), daily forecasts (`daily.temperature_2m_max/min`), current conditions (`current.temperature_2m`, `current.wind_speed_10m`)
|
|
17
|
+
- Any source returning time series of climate measurements
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
This recipe applies even for a single city: stat-cards show current conditions, the chart shows the trend over time.
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## How to use
|
|
22
22
|
|
|
23
|
-
1. **
|
|
24
|
-
- Open-Meteo
|
|
25
|
-
2. **
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
3. **
|
|
23
|
+
1. **Call the weather tool** with coordinates or city name:
|
|
24
|
+
- Open-Meteo: `get_forecast({latitude: 48.85, longitude: 2.35, hourly: "temperature_2m,precipitation", daily: "temperature_2m_max,temperature_2m_min"})`
|
|
25
|
+
2. **Extract current KPIs** and display them as stat-cards:
|
|
26
|
+
- Current temperature: `component("stat-card", {label: "Temperature", value: "18.5°C", icon: "thermometer"})`
|
|
27
|
+
- Wind: `component("stat-card", {label: "Wind", value: "12.3 km/h", icon: "wind"})`
|
|
28
|
+
- Humidity: `component("stat-card", {label: "Humidity", value: "72%", icon: "droplets"})`
|
|
29
|
+
- Precipitation: `component("stat-card", {label: "Rain (24h)", value: "2.1 mm", icon: "cloud-rain"})`
|
|
30
|
+
3. **Build the time series chart** from hourly or daily series:
|
|
31
31
|
- `component("chart-rich", {type: "line", labels: hourly.time, datasets: [{label: "Temperature °C", data: hourly.temperature_2m}]})`
|
|
32
|
-
-
|
|
33
|
-
4. **
|
|
32
|
+
- For precipitation, prefer an overlaid "bar" type
|
|
33
|
+
4. **Add the map** if coordinates are available:
|
|
34
34
|
- `component("map", {center: [lat, lon], zoom: 10, markers: [{lat, lon, label: "Paris"}]})`
|
|
35
|
-
5. **
|
|
36
|
-
- `component("kv", {pairs: [["
|
|
35
|
+
5. **Complete with details** in kv:
|
|
36
|
+
- `component("kv", {pairs: [["Sunrise", "06:42"], ["Sunset", "20:15"], ["UV Index", "5 (moderate)"]]})`
|
|
37
37
|
|
|
38
|
-
##
|
|
38
|
+
## Examples
|
|
39
39
|
|
|
40
|
-
###
|
|
40
|
+
### 7-day forecast for Paris
|
|
41
41
|
```
|
|
42
|
-
//
|
|
42
|
+
// MCP call
|
|
43
43
|
get_forecast({latitude: 48.8566, longitude: 2.3522, daily: "temperature_2m_max,temperature_2m_min,precipitation_sum"})
|
|
44
44
|
|
|
45
|
-
//
|
|
46
|
-
component("stat-card", {label: "
|
|
47
|
-
component("stat-card", {label: "
|
|
45
|
+
// Render
|
|
46
|
+
component("stat-card", {label: "Today", value: "22°C / 14°C", icon: "thermometer"})
|
|
47
|
+
component("stat-card", {label: "Expected rain", value: "0 mm", icon: "sun"})
|
|
48
48
|
component("chart-rich", {
|
|
49
49
|
type: "line",
|
|
50
50
|
labels: daily.time, // ["2026-04-09", "2026-04-10", ...]
|
|
@@ -55,21 +55,21 @@ component("chart-rich", {
|
|
|
55
55
|
})
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
###
|
|
58
|
+
### Hourly forecast with precipitation
|
|
59
59
|
```
|
|
60
60
|
component("chart-rich", {
|
|
61
61
|
type: "line",
|
|
62
62
|
labels: hourly.time.slice(0, 24),
|
|
63
63
|
datasets: [
|
|
64
64
|
{label: "Temperature °C", data: hourly.temperature_2m.slice(0, 24), yAxisID: "y"},
|
|
65
|
-
{label: "
|
|
65
|
+
{label: "Rain mm", data: hourly.precipitation.slice(0, 24), yAxisID: "y1", type: "bar"}
|
|
66
66
|
]
|
|
67
67
|
})
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
##
|
|
70
|
+
## Common mistakes
|
|
71
71
|
|
|
72
|
-
- **
|
|
73
|
-
- **
|
|
74
|
-
- **
|
|
75
|
-
- **
|
|
72
|
+
- **Displaying raw JSON data** instead of visualizing it with components
|
|
73
|
+
- **Not converting units**: Open-Meteo returns SI units by default (m/s for wind → convert to km/h if appropriate for the user)
|
|
74
|
+
- **Forgetting stat-cards** for the main KPIs: a chart alone does not surface key figures immediately
|
|
75
|
+
- **Too many points on the chart**: for hourly forecasts over 7 days (168 points), prefer daily resampling or limit to 48h in hourly mode
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: actions
|
|
3
|
-
description:
|
|
3
|
+
description: Row of action buttons
|
|
4
4
|
group: simple
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -20,9 +20,9 @@ schema:
|
|
|
20
20
|
type: boolean
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
##
|
|
24
|
-
|
|
23
|
+
## When to use
|
|
24
|
+
Offer action choices to the user — confirmation, navigation, or selection among multiple options.
|
|
25
25
|
|
|
26
|
-
##
|
|
27
|
-
1.
|
|
28
|
-
2.
|
|
26
|
+
## How to use
|
|
27
|
+
1. Identify the relevant actions based on context
|
|
28
|
+
2. Call `autoui_webmcp_widget_display('actions', { buttons: [{ label: 'Confirm', primary: true }, { label: 'Cancel' }] })`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: alert
|
|
3
|
-
description:
|
|
3
|
+
description: System alert or notification
|
|
4
4
|
group: simple
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -19,9 +19,9 @@ schema:
|
|
|
19
19
|
- error
|
|
20
20
|
---
|
|
21
21
|
|
|
22
|
-
##
|
|
23
|
-
|
|
22
|
+
## When to use
|
|
23
|
+
Signal important information, a warning, or an error to the user. Useful after an action that requires attention (e.g. threshold exceeded, operation failed).
|
|
24
24
|
|
|
25
|
-
##
|
|
26
|
-
1.
|
|
27
|
-
2.
|
|
25
|
+
## How to use
|
|
26
|
+
1. Determine the alert level based on context ('info', 'warn', 'error')
|
|
27
|
+
2. Call `autoui_webmcp_widget_display('alert', { title: 'Quota exceeded', message: 'Storage usage is above 90%', level: 'warn' })`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: cards
|
|
3
|
-
description:
|
|
3
|
+
description: Card grid with title, description, and tags
|
|
4
4
|
group: rich
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -28,14 +28,14 @@ schema:
|
|
|
28
28
|
type: string
|
|
29
29
|
---
|
|
30
30
|
|
|
31
|
-
##
|
|
32
|
-
|
|
31
|
+
## When to use
|
|
32
|
+
Display a collection of rich items — products, articles, projects, events. Each card combines a title, description, and tags. Prefer `list` for simple items without structure.
|
|
33
33
|
|
|
34
|
-
##
|
|
35
|
-
1.
|
|
36
|
-
2.
|
|
34
|
+
## How to use
|
|
35
|
+
1. Retrieve the collection via MCP
|
|
36
|
+
2. Call `autoui_webmcp_widget_display('cards', { title: 'Active projects', cards: [{ title: 'UI Redesign', description: 'Migration to Svelte 5', subtitle: 'Q2 2024', tags: ['frontend', 'high priority'] }] })`
|
|
37
37
|
|
|
38
|
-
##
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
38
|
+
## Common mistakes
|
|
39
|
+
- NEVER fabricate image URLs for the `image` field. Use ONLY the URLs returned by MCP tools. If no URL is available, do not include an image field — the widget renders correctly without it.
|
|
40
|
+
- STRICTLY FORBIDDEN: placeholder URLs (`via.placeholder.com`, `placehold.co`, `dummyimage.com`, `?text=...`). Omit the `image` field rather than using a placeholder.
|
|
41
|
+
- Always provide a `title` for each card
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: carousel
|
|
3
|
-
description:
|
|
3
|
+
description: Slide carousel (images or content)
|
|
4
4
|
group: media
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -28,12 +28,12 @@ schema:
|
|
|
28
28
|
type: number
|
|
29
29
|
---
|
|
30
30
|
|
|
31
|
-
##
|
|
32
|
-
|
|
31
|
+
## When to use
|
|
32
|
+
For sequential content browsing — presentations, step-by-step tutorials, narrative galleries. Prefer `gallery` for an overview in grid layout.
|
|
33
33
|
|
|
34
|
-
##
|
|
35
|
-
1.
|
|
36
|
-
2.
|
|
34
|
+
## How to use
|
|
35
|
+
1. Retrieve or compose the slides
|
|
36
|
+
2. Call `autoui_webmcp_widget_display('carousel', { title: 'Presentation', slides: [{ title: 'Step 1', content: 'Project introduction...' }, { title: 'Step 2', src: 'https://...', subtitle: 'Architecture' }], autoPlay: false })`
|
|
37
37
|
|
|
38
|
-
##
|
|
39
|
-
-
|
|
38
|
+
## Common mistakes
|
|
39
|
+
- Never fabricate image URLs for `src` — only use URLs returned by MCP tools
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: chart-rich
|
|
3
|
-
description:
|
|
3
|
+
description: Advanced multi-type chart (bar, line, area, pie)
|
|
4
4
|
group: rich
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -38,14 +38,14 @@ schema:
|
|
|
38
38
|
type: string
|
|
39
39
|
---
|
|
40
40
|
|
|
41
|
-
##
|
|
42
|
-
|
|
41
|
+
## When to use
|
|
42
|
+
For multi-series charts or types other than simple bars (lines, areas, pies, donuts). Prefer `chart` for a basic single-series bar chart.
|
|
43
43
|
|
|
44
|
-
##
|
|
45
|
-
1.
|
|
46
|
-
2.
|
|
47
|
-
3.
|
|
44
|
+
## How to use
|
|
45
|
+
1. Fetch data via MCP
|
|
46
|
+
2. Structure into series with `labels` (X axis) and `data` (value series)
|
|
47
|
+
3. Call `autoui_webmcp_widget_display('chart-rich', { title: 'Monthly Trend', type: 'line', labels: ['Jan', 'Feb', 'Mar'], data: [{ label: '2024', values: [10, 20, 15], color: '#4CAF50' }] })`
|
|
48
48
|
|
|
49
|
-
##
|
|
50
|
-
-
|
|
51
|
-
-
|
|
49
|
+
## Common mistakes
|
|
50
|
+
- The number of `values` in each series must match the number of `labels`
|
|
51
|
+
- Do not confuse with `chart` (simple widget) — `chart-rich` uses a different data format
|