Skip to main content
Glama

Build the React app

build_app
Destructive

Approved 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

NameRequiredDescriptionDefault
siteYesSite slug (e.g. "kopitiam-muar") or id
forceNoRebuild even if nothing changed
routesNoPage paths the app handles besides "/", e.g. ["about", "menu", "item/:id"] (":id" matches any value, e.g. /item/42). Replaces the saved list.
prerender_pathsNoKnown 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / prerender_paths
      Added value: +{
      +  "description": "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.",
      +  "items": {
      +    "maxLength": 120,
      +    "type": "string"
      +  },
      +  "maxItems": 30,
      +  "type": "array"
      +}
  2. Added

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare destructiveHint=true / readOnly=false, and the description earns credit beyond them by disclosing the returned errors with file and line, bundle sizes, index.html being written 'when missing', per-route index copies, and conditional pre-rendering. It still does not say what happens to previously built files on a failed or partial build, which matters given the destructive annotation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads an operational constraint (import by name, no install) that prevents a common failure, and the behavioral sentences are dense and non-redundant. The ~38-item package list consumes most of the opening and could be compressed, but each remaining sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a build tool with no output schema, the description covers mode precondition, automatic invocation by siblings, return values, idempotency/force semantics, and pre-render side effects. Nothing needed to invoke it correctly in React mode is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3 and all four parameters are already self-documented, including 'Replaces the saved list' for routes and prerender_paths. The description's only real semantic addition is explaining when force pays the cost of re-rendering after store data changes; nothing is added for routes/prerender_paths beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb and artifact: bundles src/ React source into /build/app.js and /build/app.css in the draft, and carries the conditional 'only for sites in React mode, see set_app_mode'. An agent can tell it apart from preview_site/publish_site (which call it implicitly). It does not differentiate itself from the sibling build_react_shop, and the opening frames the description around a package allowlist rather than the action, so it falls short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use and when-not: 'preview_site and publish_site run this automatically; call it yourself to check errors while writing code', plus a named alternative condition in set_app_mode and a distinct trigger for force: true after store data changes. Prerequisites (React mode) and the explicit alternative path are both stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources