Build the React app
build_appApproved npm packages (import by name, no install): react, react-dom, react-router, @mui/material, @mui/icons-material, @mui/lab, @mui/x-date-pickers, @mui/x-charts, @emotion/react, @emotion/styled, dayjs, motion, react-intersection-observer, react-countup, canvas-confetti, embla-carousel-react, swiper, yet-another-react-lightbox, recharts, react-markdown, lucide-react, react-hook-form, @tanstack/react-query, zustand, clsx, class-variance-authority, tailwind-merge, radix-ui, @base-ui/react, vaul, sonner, cmdk, react-day-picker, date-fns, input-otp, react-resizable-panels, next-themes. Bundle the React source in src/ into /build/app.js and /build/app.css in the draft (only for sites in React mode, see set_app_mode). Returns errors with file and line, or the bundle sizes. Also writes index.html when missing and a copy of it for each route, then pre-renders each page (when the server has a page renderer) so search engines see the real content. preview_site and publish_site run this automatically; call it yourself to check errors while writing code, or with force: true to pre-render again after the store data changed.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"site": "<site>"
},
"name": "build_app"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | Yes | Site slug (e.g. "kopitiam-muar") or id | |
| force | No | Rebuild even if nothing changed | |
| routes | No | Page paths the app handles besides "/", e.g. ["about", "menu", "item/:id"] (":id" matches any value, e.g. /item/42). Replaces the saved list. | |
| prerender_paths | No | Known addresses of routes with parameters to pre-render for search engines, e.g. ["item/42", "item/43"] for the route "item/:id" (at most 30; the most important ones). Replaces the saved list. |