{
  "x402Version": 2,
  "service": "chart-viz",
  "title": "Executive SVG Chart & KPI Card Compiler Edge API",
  "version": "1.0.0",
  "mcpEndpoint": "https://chart-viz.apikeg.com/mcp",
  "freeDiscovery": [
    "https://chart-viz.apikeg.com/llms.txt",
    "https://chart-viz.apikeg.com/llms-full.txt",
    "https://chart-viz.apikeg.com/openapi.json",
    "https://chart-viz.apikeg.com/.well-known/mcp.json",
    "https://chart-viz.apikeg.com/.well-known/api-catalog"
  ],
  "resources": [
    {
      "name": "render_chart",
      "title": "Render Publication-Grade Executive SVG Chart",
      "url": "https://chart-viz.apikeg.com/v1/render-chart",
      "method": "POST",
      "description": "Compiles structured business data into a crisp standalone SVG + base64 data URI across bar, stacked_bar, horizontal_bar, line, area, waterfall, funnel, and gantt chart types, returning a verified zero-overlap layoutReport. Why call instead of DIY: Replaces fragile headless Chromium/Canvas chart pipelines and LLM-hallucinated SVG paths with deterministic Heckbert scales and SAT text collision resolution at $0.002/chart in <10ms. Pricing: $0.002 USD per rendered executive SVG chart (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.",
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "amount": "2000",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "maxTimeoutSeconds": 60,
          "extra": {
            "priceUsd": "0.002",
            "unitDescription": "per rendered executive SVG chart",
            "dryRunQueryParam": "?dry_run=true"
          }
        }
      ],
      "extensions": {
        "bazaar": {
          "discoverable": true,
          "category": [
            "data-visualization",
            "business-intelligence",
            "reporting",
            "developer-tools"
          ],
          "info": {
            "input": {
              "type": "http",
              "method": "POST",
              "bodyType": "json",
              "example": {
                "chartType": "waterfall",
                "title": "FY26 Net ARR Bridge",
                "subtitle": "Consolidated SaaS ($USD)",
                "palette": "corporate",
                "valueFormat": "currency",
                "currencySymbol": "$",
                "unitSuffix": "",
                "width": 840,
                "height": 480,
                "showGrid": true,
                "waterfallSteps": [
                  {
                    "label": "Opening ARR",
                    "value": 4200000,
                    "kind": "start"
                  },
                  {
                    "label": "New Logos",
                    "value": 1150000,
                    "kind": "delta"
                  },
                  {
                    "label": "Expansion",
                    "value": 680000,
                    "kind": "delta"
                  },
                  {
                    "label": "Gross ARR",
                    "kind": "subtotal"
                  },
                  {
                    "label": "Contraction",
                    "value": -210000,
                    "kind": "delta"
                  },
                  {
                    "label": "Logo Churn",
                    "value": -320000,
                    "kind": "delta"
                  },
                  {
                    "label": "Ending ARR",
                    "kind": "total"
                  }
                ]
              }
            },
            "output": {
              "type": "json",
              "summary": "Standalone 840x480 SVG + data:image/svg+xml;base64 URI with zeroOverlapsVerified=true."
            }
          },
          "schema": {
            "inputSchema": {
              "type": "object",
              "properties": {
                "chartType": {
                  "type": "string",
                  "enum": [
                    "bar",
                    "stacked_bar",
                    "horizontal_bar",
                    "line",
                    "area",
                    "waterfall",
                    "funnel",
                    "gantt"
                  ],
                  "description": "Enterprise chart type: 'bar', 'stacked_bar', 'horizontal_bar', 'line', 'area', 'waterfall', 'funnel', or 'gantt'."
                },
                "title": {
                  "type": "string",
                  "maxLength": 180,
                  "description": "Executive headline chart title."
                },
                "subtitle": {
                  "type": "string",
                  "maxLength": 220,
                  "description": "Context subtitle (timeframe, unit scope, or cohort)."
                },
                "footnote": {
                  "type": "string",
                  "maxLength": 240,
                  "description": "Source attribution or footnote rendered along the bottom edge."
                },
                "width": {
                  "type": "integer",
                  "default": 840,
                  "minimum": 360,
                  "maximum": 2400,
                  "description": "Target SVG viewport width in pixels."
                },
                "height": {
                  "type": "integer",
                  "default": 480,
                  "minimum": 240,
                  "maximum": 1800,
                  "description": "Target SVG viewport height in pixels (auto-expands if dense rows/margins require it)."
                },
                "palette": {
                  "type": "string",
                  "enum": [
                    "corporate",
                    "slate",
                    "emerald",
                    "dark"
                  ],
                  "default": "corporate",
                  "description": "Accessible executive palette ('corporate', 'slate', 'emerald', or 'dark')."
                },
                "valueFormat": {
                  "type": "string",
                  "enum": [
                    "compact",
                    "currency",
                    "percent",
                    "percent_ratio",
                    "integer",
                    "decimal",
                    "raw"
                  ],
                  "default": "compact",
                  "description": "Axis and data-label formatter ('compact' -> 12.4K, 'currency' -> $1.2M, 'percent' -> 45.3%, 'percent_ratio' -> 0.453 as 45.3%, 'integer', 'decimal', 'raw')."
                },
                "currencySymbol": {
                  "type": "string",
                  "default": "$",
                  "maxLength": 8,
                  "description": "Currency symbol prefix used when valueFormat is 'currency'."
                },
                "unitSuffix": {
                  "type": "string",
                  "default": "",
                  "maxLength": 16,
                  "description": "Optional unit suffix appended to formatted values (e.g. ' ms', 'x')."
                },
                "xAxisLabel": {
                  "type": "string",
                  "maxLength": 120,
                  "description": "Optional horizontal axis title."
                },
                "yAxisLabel": {
                  "type": "string",
                  "maxLength": 120,
                  "description": "Optional vertical axis title."
                },
                "showDataLabels": {
                  "type": "boolean",
                  "description": "Render collision-checked value labels directly on bars/points."
                },
                "showLegend": {
                  "type": "boolean",
                  "description": "Override automatic legend visibility."
                },
                "showGrid": {
                  "type": "boolean",
                  "default": true,
                  "description": "Render subtle dashed reference gridlines."
                },
                "includeZero": {
                  "type": "boolean",
                  "description": "Force numeric scale to include the 0 baseline."
                },
                "categories": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "minItems": 1,
                  "maxItems": 120,
                  "description": "Category or time-bucket labels for bar, stacked_bar, horizontal_bar, line, and area charts."
                },
                "series": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120,
                        "description": "Series legend name (e.g. 'Enterprise ARR' or 'FY26 Actuals')."
                      },
                      "values": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "description": "Numeric data values corresponding 1:1 with categories."
                        },
                        "minItems": 1,
                        "maxItems": 120,
                        "description": "Ordered numeric values matching categories length."
                      },
                      "color": {
                        "type": "string",
                        "maxLength": 32,
                        "pattern": "^#[0-9A-Fa-f]{6}$",
                        "description": "Optional 6-digit hex color override (e.g. '#1D4ED8')."
                      }
                    },
                    "required": [
                      "name",
                      "values"
                    ],
                    "additionalProperties": false,
                    "description": "Named numeric data series."
                  },
                  "minItems": 1,
                  "maxItems": 12,
                  "description": "1 to 12 data series for Cartesian charts."
                },
                "referenceLine": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "number",
                      "description": "Target or threshold axis value for the dashed reference line."
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 100,
                      "description": "Optional callout badge text (defaults to 'Target: <formatted value>')."
                    },
                    "color": {
                      "type": "string",
                      "maxLength": 32,
                      "pattern": "^#[0-9A-Fa-f]{6}$",
                      "description": "Optional 6-digit hex color override for the reference line."
                    }
                  },
                  "required": [
                    "value"
                  ],
                  "additionalProperties": false,
                  "description": "Optional target/threshold reference line."
                },
                "waterfallSteps": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120,
                        "description": "Bridge step label (e.g. 'Opening ARR', 'Expansion', 'Churn', 'Ending ARR')."
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "start",
                          "delta",
                          "subtotal",
                          "total"
                        ],
                        "description": "Bridge step role: 'start' (initial baseline), 'delta' (+/- bridge change), 'subtotal' (running intermediate total), or 'total' (final total)."
                      },
                      "value": {
                        "type": "number",
                        "description": "Step amount. Required for 'start' and 'delta'; optional for 'subtotal' and 'total' (auto-computed from running balance when omitted)."
                      }
                    },
                    "required": [
                      "label",
                      "kind"
                    ],
                    "additionalProperties": false,
                    "description": "Executive waterfall financial/ops bridge step."
                  },
                  "minItems": 2,
                  "maxItems": 40,
                  "description": "Ordered bridge steps for 'waterfall' charts."
                },
                "funnelStages": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120,
                        "description": "Conversion funnel stage name (e.g. 'Qualified Pipeline')."
                      },
                      "value": {
                        "type": "number",
                        "minimum": 0,
                        "description": "Non-negative volume or revenue at this stage."
                      },
                      "color": {
                        "type": "string",
                        "maxLength": 32,
                        "pattern": "^#[0-9A-Fa-f]{6}$",
                        "description": "Optional 6-digit hex color override."
                      }
                    },
                    "required": [
                      "label",
                      "value"
                    ],
                    "additionalProperties": false,
                    "description": "Conversion funnel stage."
                  },
                  "minItems": 2,
                  "maxItems": 20,
                  "description": "Ordered conversion stages for 'funnel' charts."
                },
                "ganttTasks": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 64,
                        "description": "Optional caller task identifier."
                      },
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 140,
                        "description": "Workstream or milestone title."
                      },
                      "start": {
                        "type": "string",
                        "minLength": 8,
                        "maxLength": 40,
                        "description": "ISO 8601 start date (e.g. '2026-04-01')."
                      },
                      "end": {
                        "type": "string",
                        "minLength": 8,
                        "maxLength": 40,
                        "description": "ISO 8601 end date (e.g. '2026-04-21'). Omit or match start for milestones."
                      },
                      "group": {
                        "type": "string",
                        "maxLength": 80,
                        "description": "Optional swimlane/owner prefix (e.g. 'Platform' or 'GTM')."
                      },
                      "progress": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100,
                        "description": "Optional completion percentage [0-100] rendered inside the bar."
                      },
                      "milestone": {
                        "type": "boolean",
                        "description": "Set true to render as a diamond milestone marker."
                      },
                      "color": {
                        "type": "string",
                        "maxLength": 32,
                        "pattern": "^#[0-9A-Fa-f]{6}$",
                        "description": "Optional 6-digit hex color override."
                      }
                    },
                    "required": [
                      "label",
                      "start"
                    ],
                    "additionalProperties": false,
                    "description": "Gantt timeline task or milestone row."
                  },
                  "minItems": 1,
                  "maxItems": 60,
                  "description": "Timeline tasks and milestones for 'gantt' charts."
                },
                "ganttMilestones": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100,
                        "description": "Vertical milestone callout label (e.g. 'GA Launch')."
                      },
                      "date": {
                        "type": "string",
                        "minLength": 8,
                        "maxLength": 40,
                        "description": "ISO 8601 milestone date (e.g. '2026-06-01')."
                      },
                      "color": {
                        "type": "string",
                        "maxLength": 32,
                        "pattern": "^#[0-9A-Fa-f]{6}$",
                        "description": "Optional 6-digit hex color override."
                      }
                    },
                    "required": [
                      "label",
                      "date"
                    ],
                    "additionalProperties": false,
                    "description": "Vertical milestone guide line across the Gantt timeline."
                  },
                  "minItems": 1,
                  "maxItems": 12,
                  "description": "Optional vertical milestone guide lines for 'gantt' charts."
                }
              },
              "required": [
                "chartType"
              ],
              "additionalProperties": false
            },
            "outputSchema": {
              "type": "object",
              "required": [
                "ok",
                "data",
                "_meta"
              ],
              "properties": {
                "ok": {
                  "type": "boolean",
                  "const": true
                },
                "data": {
                  "type": "object",
                  "description": "Deterministic structured tool result payload."
                },
                "_meta": {
                  "type": "object",
                  "required": [
                    "requestId",
                    "durationMs",
                    "chargedUsd",
                    "dryRun"
                  ],
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "durationMs": {
                      "type": "number"
                    },
                    "chargedUsd": {
                      "type": "string"
                    },
                    "dryRun": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "name": "render_kpi_card",
      "title": "Render Executive KPI Snapshot Card",
      "url": "https://chart-viz.apikeg.com/v1/render-kpi-card",
      "method": "POST",
      "description": "Renders 1-6 executive KPI summary tiles with formatted headline values ($1.2M, 45.3%), semantic trend pills (+14.2% MoM), and inline SVG sparklines ready for Slack, Notion, Email, PDFs, or slide decks. Why call instead of DIY: Instant board-grade visual metric snapshot with proportional typography and zero-overlap verification at $0.001/card. Pricing: $0.001 USD per executive KPI snapshot card (1-6 tiles) (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.",
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "amount": "1000",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "maxTimeoutSeconds": 60,
          "extra": {
            "priceUsd": "0.001",
            "unitDescription": "per executive KPI snapshot card (1-6 tiles)",
            "dryRunQueryParam": "?dry_run=true"
          }
        }
      ],
      "extensions": {
        "bazaar": {
          "discoverable": true,
          "category": [
            "data-visualization",
            "business-intelligence",
            "reporting",
            "developer-tools"
          ],
          "info": {
            "input": {
              "type": "http",
              "method": "POST",
              "bodyType": "json",
              "example": {
                "title": "November SaaS Flash Report",
                "subtitle": "Consolidated Actuals vs. Prior Month",
                "palette": "corporate",
                "metrics": [
                  {
                    "label": "Ending ARR",
                    "value": 14800000,
                    "format": "currency",
                    "currencySymbol": "$",
                    "unitSuffix": "",
                    "deltaPercent": 14.2,
                    "deltaPeriod": "MoM",
                    "sparkline": [
                      11200000,
                      12100000,
                      12950000,
                      13800000,
                      14800000
                    ],
                    "subtext": "Plan: $14.2M"
                  },
                  {
                    "label": "Net Dollar Retention",
                    "value": 118.4,
                    "format": "percent",
                    "currencySymbol": "$",
                    "unitSuffix": "",
                    "deltaPercent": 2.1,
                    "deltaPeriod": "QoQ",
                    "sparkline": [
                      114,
                      115.2,
                      116.3,
                      118.4
                    ]
                  },
                  {
                    "label": "Logo Churn",
                    "value": 1.8,
                    "format": "percent",
                    "currencySymbol": "$",
                    "unitSuffix": "",
                    "deltaPercent": -0.6,
                    "deltaPeriod": "MoM",
                    "invertSentiment": true,
                    "sparkline": [
                      2.9,
                      2.5,
                      2.4,
                      1.8
                    ]
                  }
                ]
              }
            },
            "output": {
              "type": "json",
              "summary": "Standalone 3-column SVG KPI card with semantic green trend pills and inline gradient sparklines."
            }
          },
          "schema": {
            "inputSchema": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "maxLength": 160,
                  "description": "Optional executive card header title."
                },
                "subtitle": {
                  "type": "string",
                  "maxLength": 200,
                  "description": "Optional card subtitle or reporting period."
                },
                "footnote": {
                  "type": "string",
                  "maxLength": 200,
                  "description": "Optional footer attribution note."
                },
                "palette": {
                  "type": "string",
                  "enum": [
                    "corporate",
                    "slate",
                    "emerald",
                    "dark"
                  ],
                  "default": "corporate",
                  "description": "Accessible executive color palette ('corporate', 'slate', 'emerald', or 'dark')."
                },
                "columns": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3,
                  "description": "Grid column count (1-3). Defaults automatically from tile count."
                },
                "width": {
                  "type": "integer",
                  "minimum": 320,
                  "maximum": 2400,
                  "description": "SVG width in pixels (defaults to 400/680/940 for 1/2/3 columns)."
                },
                "metrics": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80,
                        "description": "KPI tile metric title (e.g. 'Net New ARR', 'Gross Margin', 'NDR')."
                      },
                      "value": {
                        "type": "number",
                        "description": "Headline numeric metric value."
                      },
                      "displayValue": {
                        "type": "string",
                        "maxLength": 40,
                        "description": "Optional custom pre-formatted headline override (e.g. '4.2 mos')."
                      },
                      "format": {
                        "type": "string",
                        "enum": [
                          "compact",
                          "currency",
                          "percent",
                          "percent_ratio",
                          "integer",
                          "decimal",
                          "raw"
                        ],
                        "default": "compact",
                        "description": "Number format for headline value ('currency', 'percent', 'compact', etc.)."
                      },
                      "currencySymbol": {
                        "type": "string",
                        "default": "$",
                        "maxLength": 8,
                        "description": "Currency symbol when format is 'currency'."
                      },
                      "unitSuffix": {
                        "type": "string",
                        "default": "",
                        "maxLength": 16,
                        "description": "Optional unit suffix (e.g. ' bps', 'x')."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 4,
                        "description": "Optional fixed decimal precision override."
                      },
                      "deltaText": {
                        "type": "string",
                        "maxLength": 48,
                        "description": "Explicit trend pill text (e.g. '+14.2% MoM' or '-40 bps QoQ')."
                      },
                      "deltaPercent": {
                        "type": "number",
                        "description": "Numeric percentage change used to build the trend pill when deltaText is omitted (e.g. 14.2 -> '+14.2%')."
                      },
                      "deltaPeriod": {
                        "type": "string",
                        "maxLength": 24,
                        "description": "Comparison window appended to deltaPercent (e.g. 'MoM', 'QoQ', 'YoY')."
                      },
                      "sentiment": {
                        "type": "string",
                        "enum": [
                          "positive",
                          "negative",
                          "neutral"
                        ],
                        "description": "Explicit trend pill color semantics ('positive', 'negative', or 'neutral')."
                      },
                      "invertSentiment": {
                        "type": "boolean",
                        "description": "Set true when negative deltas are good (e.g. Churn Rate, CAC Payback, P99 Latency)."
                      },
                      "sparkline": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        },
                        "minItems": 2,
                        "maxItems": 120,
                        "description": "Optional historical series (2-120 points) rendered as an inline vector sparkline."
                      },
                      "subtext": {
                        "type": "string",
                        "maxLength": 64,
                        "description": "Optional secondary benchmark text (e.g. 'Plan: $1.10M')."
                      }
                    },
                    "required": [
                      "label",
                      "value"
                    ],
                    "additionalProperties": false,
                    "description": "Single KPI metric tile specification."
                  },
                  "minItems": 1,
                  "maxItems": 6,
                  "description": "1 to 6 executive KPI tiles to render."
                }
              },
              "required": [
                "metrics"
              ],
              "additionalProperties": false
            },
            "outputSchema": {
              "type": "object",
              "required": [
                "ok",
                "data",
                "_meta"
              ],
              "properties": {
                "ok": {
                  "type": "boolean",
                  "const": true
                },
                "data": {
                  "type": "object",
                  "description": "Deterministic structured tool result payload."
                },
                "_meta": {
                  "type": "object",
                  "required": [
                    "requestId",
                    "durationMs",
                    "chargedUsd",
                    "dryRun"
                  ],
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "durationMs": {
                      "type": "number"
                    },
                    "chargedUsd": {
                      "type": "string"
                    },
                    "dryRun": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  ]
}