# MetaModel — Complete Reference > Build interactive calculators, models, and formula-driven applications — no code required. MetaModel is a web application at https://www.metamodel.app for building structured calculators, configurators, and engineering models. Users write formulas like a spreadsheet, organize them into models with inputs and computed outputs, and publish as interactive apps for clients and teams. --- ## Core Architecture ### Project Top-level container. Contains pages, models, components, and references to toolbox content (tables, lists). Projects can be published as shareable web apps or saved as cases (filled-in work products). ### Model A model contains formulas applied to a subject component. Each formula creates input properties (user-editable) and output properties (computed, read-only). Models have a title and description. Example: A "Volume Calculator" model with inputs (length, width, height) and output (volume = length * width * height). ### Component Data item with typed properties. A model's subject is a component. Properties have names, types, values, optional validation, and optional indicators. ### Page Container for views. Projects can have multiple pages displayed as tabs, steps, or wizard navigation. Pages support themes (Default, Corkboard, Workbench, Chalkboard, Technical, Healthcare, Financial, Graph Paper). ### View Types | Type | Description | Use Case | |------|-------------|----------| | Form (ModelForm) | Interactive form with labeled inputs and computed outputs | Primary calculator interface | | Spreadsheet | AG Grid spreadsheet view of properties | Data-heavy models | | Markdown | Rich text with template variables `{{propName@modelName}}` | Reports, summaries | | Section | Layout container for nested views (horizontal/vertical) | Grouping related content | | Text | Simple text area | Notes, labels | | Image | Image display with sizing controls | Diagrams, photos | ### Sections Use sections to group 2-3 model form views side by side on the same page. This creates a denser, more professional layout where users can see cross-model outputs update in real time. --- ## Property Types | Type | Description | Example Values | When to Use | |------|-------------|----------------|-------------| | integer | Whole numbers | 0, 1, 42, -5 | Counts, quantities, ages | | double | Decimal numbers | 3.14, 0.5, -2.7 | Measurements, ratios | | currency | Money (displays in the PROJECT's currency — EUR, USD, …) | 100, 49.99 | Prices, costs, budgets | | percent | Percentages (displays with %) | 0.15 (= 15%) | Rates, tax rates, discounts | | text | Text strings | "hello", "red" | Names, descriptions | | boolean | True/false | true, false | Toggles, flags | | date | Calendar dates (canonical ISO strings) | "2026-08-02" | Deadlines, schedules | Choose the most specific type: Use `currency` for money (not double), `percent` for rates (not double), `integer` for counts (not double). --- ## Formula Language Formulas use assignment syntax: `output = expression` ### Operators +, -, *, /, % (modulo), ^ (power), = (equality, Excel-style), <> (not equal), <, >, <=, >=, AND, OR, NOT **IMPORTANT**: Use single `=` for equality comparison (not `==`). Use `<>` for not-equal (not `!=`). ### Scientific Notation Supported: `3.986e14`, `1.5E-3`, `2e+6` ### Cross-Model References Use `propertyName@modelName` to reference properties from other models. Example: `totalCost = unitCost@pricing * quantity` ### Relations, Aggregates & Scoped (Fan-out) Formulas Components can hold RELATIONS — named collections of member components (e.g. `dakvlakken` roof faces, `rungs`, part lists). - Aggregates: `SUM(relation, "prop")` · `SUMIF(relation, "valueProp", "matchProp", matchValue)` · `COUNT(relation)` - SCOPED formulas evaluate once per member (per-row calculations): a formula scoped to `dakvlakken` computes an output on EVERY face; aggregates then roll them up. - Member properties resolve member-first, then one hop to the subject. ### Rules (declarative managers) - **Quantity rule**: manages a relation's member count with a formula — `count = CEILING((height - offsets) / maxSpacing) + 1`, or CONDITIONAL existence: `count = IF(mountStyle = "Clevis", 2, 0)` (parts appear/disappear as inputs change). - **Check rule**: asserts an expression (`COUNT(dakvlakken) >= 1`); observe mode flags, prevent mode refuses the violating change with a message. - **Distribute rule**: fills a span with spaced members (fill-to-max-pitch or fixed count) and writes their coordinates. - **Show rule**: derives 3D geometry per product member — geometry exists BECAUSE the product needs showing; rules add/remove members and the 3D follows. ### 3D Scenes Scene views render derived geometry (Three.js): blocks, cylinders, tubes (real inner diameter), cones, spheres, elbows. Materials (metalness/roughness/color/opacity) come from a Materials table and bind per member. Dimensions and placements are formulas — the scene reconfigures live. In API schemas/results these models are flagged `presentation: true`. ### Boolean Coercion Boolean values are automatically 0 or 1 in numeric context. Use directly in math: `total = bit3*8 + bit2*4 + bit1*2 + bit0` --- ## Built-in Functions (Complete List) ### Math - ABS(value) — Absolute value - ROUND(value, decimals) — Round to decimal places - ROUNDUP(value, decimals) — Round up - ROUNDDOWN(value, decimals) — Round down - FLOOR(value) — Round down to integer - CEILING(value) — Round up to integer - SQRT(value) — Square root - POWER(base, exp) — Exponentiation - MOD(value, divisor) — Modulo - INT(value) — Integer part - SIGN(value) — Returns -1, 0, or 1 - TRUNC(value, [decimals]) — Truncate - MROUND(value, multiple) — Round to nearest multiple - QUOTIENT(numerator, denominator) — Integer division - CLAMP(value, min, max) — Constrain to range ### Trigonometry - SIN(radians), COS(radians), TAN(radians) - ASIN(value), ACOS(value), ATAN(value) - ATAN2(y, x) — Two-argument arctangent - RADIANS(degrees) — Convert degrees to radians - DEGREES(radians) — Convert radians to degrees - PI() — 3.14159... - E() — 2.71828... - TAU() — 2π ### Statistics - MIN(values...) — Minimum - MAX(values...) — Maximum - SUM(values...) — Sum - AVERAGE(values...) — Mean - MEDIAN(values...) — Median - STDEV(values...) — Standard deviation - COUNT(values...) — Count of numbers - COUNTA(values...) — Count of non-empty - COUNTBLANK(values...) — Count of empty - MODE(values...) — Most frequent value - RANK(value, ...values) — Rank in dataset - VAR(values...) — Variance (sample) - VARP(values...) — Variance (population) - PERCENTILE(...values, k) — kth percentile - QUARTILE(...values, q) — Quartile (0-4) - LARGE(values..., k) — kth largest - SMALL(values..., k) — kth smallest - PRODUCT(values...) — Product of all values ### String - CONCATENATE(values...) — Join strings - TEXTJOIN(delimiter, ignoreEmpty, ...values) — Join with delimiter - LEFT(text, count) — Left substring - RIGHT(text, count) — Right substring - MID(text, start, count) — Middle substring - LEN(text) — Length - UPPER(text), LOWER(text), PROPER(text) — Case conversion - TRIM(text) — Remove extra whitespace - CLEAN(text) — Remove non-printable characters - SUBSTITUTE(text, old, new) — Replace text - FIND(search, text) — Case-sensitive position - SEARCH(search, text) — Case-insensitive position - REPLACE(text, start, count, new) — Replace by position - REPT(text, count) — Repeat text - TEXT(value, format) — Format number as text - VALUE(text) — Parse text as number - EXACT(text1, text2) — Case-sensitive comparison ### Logic - IF(condition, trueValue, falseValue) — Conditional - IFS(cond1, val1, cond2, val2, ...) — Multiple conditions - IFERROR(value, errorValue) — Catch errors - IFNA(value, naValue) — Catch #N/A errors - SWITCH(expr, case1, val1, case2, val2, ..., [default]) — Multi-case - AND(values...) — All true - OR(values...) — Any true - NOT(value) — Negate ### Financial - PMT(rate, nper, pv) — Payment - PV(rate, nper, pmt) — Present value - FV(rate, nper, pmt) — Future value - NPER(rate, pmt, pv) — Number of periods - RATE(nper, pmt, pv) — Interest rate - NPV(rate, values...) — Net present value - IRR(values...) — Internal rate of return - IPMT(rate, per, nper, pv) — Interest portion of payment - PPMT(rate, per, nper, pv) — Principal portion of payment ### Date/Time - NOW() — Current date/time - TODAY() — Current date - YEAR(date), MONTH(date), DAY(date) — Extract parts - HOUR(datetime), MINUTE(datetime), SECOND(datetime) - DATE(year, month, day) — Create date - TIME(hours, minutes, seconds) — Create time - WEEKDAY(date, [type]) — Day of week - DATEDIF(start, end, unit) — Date difference (unit: "Y", "M", "D") - EDATE(date, months) — Add months - EOMONTH(date, months) — End of month after adding months - NETWORKDAYS(start, end) — Working days between dates - WORKDAY(start, days) — Add working days ### Engineering (Base Conversion) - DEC2BIN(number, [places]), DEC2HEX(number, [places]), DEC2OCT(number, [places]) - BIN2DEC(text), BIN2HEX(text), BIN2OCT(text) - HEX2DEC(text), HEX2BIN(text), HEX2OCT(text) - OCT2DEC(text), OCT2BIN(text), OCT2HEX(text) All support optional [places] parameter for zero-padding. ### Other - RAND() — Random number 0-1 - RANDBETWEEN(min, max) — Random integer in range - CHOOSE(index, val1, val2, ...) — Select by index - COMBIN(n, k) — Combinations - FACT(n) — Factorial - GCD(values...) — Greatest common divisor - LCM(values...) — Least common multiple ### Aggregate Self-Reference - SUM(@), AVERAGE(@), MIN(@), MAX(@) — References all numeric properties on current component ### Lookup - LOOKUP("TableName", inputValue, "columnName", "exact"|"threshold") - "exact": Find row where input matches exactly (case-insensitive for text) - "threshold": Find highest row where threshold ≤ input (for numeric tiers) - Auto-detects mode from input column type if 4th argument omitted - Threshold + a "previous capacity" key column = SELECTION LADDERS (smallest standard part ≥ requirement: motors, rod diameters, filter housings) - Date columns support threshold matching (date-based tiers) ### Dates Canonical date value = ISO string ("2026-08-02"). date − date = days; date ± n; date-aware MIN/MAX and range validation; NETWORKDAYS/WORKDAY (holiday lists), DATEVALUE, EDATE, EOMONTH. Formula literals: quoted ISO strings. --- ## Lookup Tables Tables provide reference data for LOOKUP() formulas. Structure: - Input column: The lookup key (what you search by) - Output columns: Result columns (what you get back) - Rows: Data entries Example — Shipping rates by weight: ``` Table: ShippingRates Input: minWeight (numeric) Outputs: rate (currency), carrier (text) Rows: 0 → $5.99, USPS 5 → $12.99, UPS 20 → $24.99, FedEx ``` Formula: `shippingCost = LOOKUP("ShippingRates", packageWeight, "rate", "threshold")` Tables are stored in toolboxes and can be shared across projects. System toolboxes provide standard reference tables (US States, Common Materials, unit conversions). --- ## Lists (Dropdown Validation) Lists provide dropdown options for properties. Built-in lists: - YesNo (0/1), TrueFalse, OnOff (0/1) - Priority (Low/Medium/High/Critical) - RAGStatus (Red/Amber/Green) Custom lists can be created in toolboxes with any label/value pairs. --- ## Indicators (Visual Feedback) Indicators add colored visual signals to properties based on their values. ### Threshold Mode Ascending numeric bands — highest band where threshold ≤ value wins. ``` Bands: 0=error(red), 50=warning(yellow), 80=success(green) Value 75 → warning (yellow) Value 90 → success (green) ``` ### Expression Mode Boolean conditions — first match (top-to-bottom) wins. ``` Bands: "< 0" → error, ">= 0" → success ``` Colors: success (green), warning (yellow), error (red), info (blue), primary (cyan), neutral (gray) --- ## Validation Properties can have validation rules: - **Range**: min/max bounds for numeric values - **List**: Dropdown from a defined list - **Enum**: Inline options (planned) --- ## Publishing & Cases ### Publish Projects can be published as standalone web apps with a shareable URL. Viewers can enter values and see formulas recalculate — no account needed. Publishers choose light/dark/system color mode for viewers. ### Cases Cases are filled-in instances of a project — the work product. A project is the tool (template), a case saves specific input values and computed outputs. Cases support autosave. --- ## Compute API & MCP (for AI assistants and integrations) Every published project exposes its engine: - `GET https://www.metamodel.app/api/compute/{token}` → schema: every input (type, default, valid range), every output, per model. 3D presentation models flagged `presentation: true`. - `POST https://www.metamodel.app/api/compute/{token}` with `{"inputs": {"name": value, ...}}` → every output computed server-side by the same dependency-tracked engine (formulas, lookups, rules). - MCP endpoint: `https://www.metamodel.app/api/mcp` — tools `metamodel_list_projects`, `metamodel_get_schema`, `metamodel_compute`. Add to claude.ai as a custom connector or point any MCP client at it. Open-source server: https://github.com/metamodel-app/mcp-server - Publish tokens are public read-and-compute capabilities; unpublishing revokes. - Docs: https://www.metamodel.app/developers --- ## AI Builder Describe what you need in natural language and the AI generates a working project with: - Models with input/output properties - Formulas with correct syntax - Indicators for visual feedback - Lookup tables when data-driven logic is needed - Custom lists for dropdown selections - SVG diagrams for technical calculators - Summary page with markdown report Example prompt: "Build a car loan calculator with vehicle price, down payment, trade-in value, sales tax rate, loan term, and APR. Show monthly payment, total interest, and total cost with color-coded affordability indicators." --- ## Example Projects - **Hydraulic Cylinder Configurator** — engineer-to-order: Euler buckling + direct-stress rod selection from a standard ladder, hoop-stress wall, conditional mounting hardware that physically swaps in 3D, mass-based costing and quote. Live: https://www.metamodel.app/demo/configurator?demo=cylinder (compute token d5279c53-ceb3-4b26-b2ac-71caf2e3c3ae) - **Conveyor Section Designer** — rollers placed by a fill rule, IEC motor selected by threshold ladder, live 3D and BOM. Live: https://www.metamodel.app/demo/configurator - **Solar instant-quote widget** — multi-roof-face collections with per-face fan-out formulas, live in production at https://eerlijkzon.nl - **Deck Builder** — residential deck with code-compliant sizing - **Pressure Vessel Calculator** — ASME-flavor wall thickness and stress - **Car Loan Calculator** — PMT(), indicators, markdown summary Try live examples at: https://www.metamodel.app/examples