SuperAPI AI 工具集

maple-dashboard-widgets

数据与分析

查看项目

更新于 10-16 00:05

技能介绍

用途:在 Maple 中通过 MCP 构建、修复或审查仪表盘小组件,适用于 create_dashboard、add_dashboard_widget、update_dashboard_widget、replace_dashboard_widgets 等操作。新建仪表盘优先使用 create_dashboard 的简化 widgets 数组;需要多查询图表、公式、隐藏序列或非默认转换时再写原始 JSON。

主要能力:panel_type 决定小组件类型,并自动推导 visualization、display.chartId 与原始 SQL 类型。支持 line、bar、hbar、area、pie、stat、gauge、table、list、histogram、heatmap、funnel、paths、markdown。数据源为按 kind 区分的联合类型:query、raw_sql、route、static,每个分支都必须带 kind。query 需 resultShape(timeseries、breakdown 或 list)。stat/gauge 需要 transform.reduceToValue,聚合可选 sum、first、count、avg、max、min。

使用方式:funnel 与 paths 通过 display_json 定义,add_dashboard_widget 会自动推导 route 数据源,不要传 data_source_json。漏斗步骤 1–10,keyBy 支持 person、visitor、user、session,windowSeconds 必须为正。路径需 anchor,direction 为 after 或 before,depth 1–5,branches 1–10。可用 list_product_events 查看事件名,用 query_funnel 先试定义。

限制与注意:三类静默失败需警惕——{ endpoint, params } 是已废弃的 v2 结构,无法解码;percent 表示 0–1 分数,percent_100 表示 0–100,与 Grafana 相反;groupBy 仅在 addOns.groupBy 为 true 时生效。MCP 成功不代表图表正确,需阅读 inspect_chart_data 的 verdict,suspicious 或 broken 应修复后重提。display.unit 为开放字符串,无法识别的值会保存但按普通数字渲染。gauge 弧线默认 0–100,百分比仪表需设 display.gauge.min/max。