metricui

v0.2.0
io.github.mpmcgowen/metricui Checked 2 hours ago Published 8 months ago

React dashboard components — API lookup, code generation, and prop validation for AI tools.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_components

List all MetricUI components, optionally filtered by category

ParameterTypeDescription
categorystringFilter by category

search_components

Search MetricUI components by use case description. Returns ranked results.

ParameterTypeDescription
query *stringNatural language, e.g. 'show revenue over time' or 'pie chart'

get_component_api

Get the full API reference for a specific MetricUI component — all props, types, defaults, examples

ParameterTypeDescription
component *stringComponent name, e.g. 'KpiCard', 'AreaChart', 'DataTable'

get_component_example

Returns a complete, working code example for a MetricUI component with the requested features enabled. The example uses realistic sample data and has every relevant prop annotated. You adapt the values/labels to your specific use case — the structure and props are correct as-is.

ParameterTypeDescription
component *stringComponent name: KpiCard, AreaChart, BarChart, DonutChart, LineChart, DataTable, StatGroup, Sparkline, Badge
featuresarrayFeatures to include in the example: comparison, sparkline, goal, conditions, dense, animation, stacked, grouped, horizontal, footer, pagination, etc.

generate_dashboard

Generate a COMPLETE, production-quality MetricUI dashboard with theme presets, MetricGrid auto-layout, DashboardHeader with live status, FilterProvider + PeriodSelector, advanced KpiCards (conditions, goals, sparkline overlays), charts with reference lines and threshold bands, data-driven Callout alerts, and rich DataTable. Returns a full page.tsx file ready to use.

ParameterTypeDescription
description *stringDashboard description: 'SaaS metrics with MRR, churn, user growth, revenue breakdown, and top customers table'
metricsarraySpecific metrics/sections to include
stylestringLayout density
themestringTheme preset (default: indigo)
variantstring

generate_data_shape

Generate the TypeScript interface for a component's required data shape

ParameterTypeDescription
component *stringComponent name
seriesarraySeries/field names to include

generate_table_columns

Generate DataTable column definitions from a list of fields

ParameterTypeDescription
fields *arrayField definitions

generate_provider_config

Generate MetricProvider configuration JSX with only the fields you need

ParameterTypeDescription
animateboolean
currencystring
denseboolean
localestring
nullDisplaystring
variantstring

validate_props

Validate a MetricUI component's prop configuration — catches unknown props, type mismatches, deprecated usage, and common mistakes

ParameterTypeDescription
component *string
props *objectProps to validate as key-value pairs

suggest_format

Suggest the right format configuration for a value type

ParameterTypeDescription
valueType *stringWhat kind of value: revenue, percentage, time, count, etc.
sampleValuenumberA sample value to show formatted output

get_setup_guide

Get complete setup instructions for MetricUI — install commands, peer dependencies, provider setup, CSS imports, and framework-specific configuration for Next.js, Vite, or CRA.

ParameterTypeDescription
frameworkstringTarget framework (default: nextjs)

init_project

Initialize a project for MetricUI — generates CLAUDE.md content with usage instructions so AI tools always use MetricUI components. Run this once per project.

search_docs

Search all MetricUI documentation — components, props, types, patterns, format examples, and guides. Returns ranked results with snippets. Use this when a user asks conceptual questions like 'how do I set up dark mode?' or 'what format should I use for currency?'

ParameterTypeDescription
query *stringNatural language query, e.g. 'how to format currency', 'dark mode setup', 'table pagination', 'sparkline'
limitnumberMax results to return (default 5)
typestringFilter results by content type