Skip to main content
Glama

put_component

Idempotent

Create or replace a project component's source and props schema; validate and build it first, keeping the existing version if anything fails.

Instructions

Create or replace a project component's source and/or props schema (components//component., schema.json). code: an ES module whose default export is the element class, in JavaScript, TypeScript or JSX (file: component.js, .ts, .tsx, .jsx; default: the one there, else .js). Anything but a plain component.js is bundled into one module by MOGA (esbuild): it may import its own files in the folder and packages from the project's node_modules; JSX makes real DOM elements (SVG inside ) unless the file asks for React (/** @jsxRuntime automatic / /* @jsxImportSource react */). MOGA defines the tag and calls renderAt(t, props, ctx) every frame with t in seconds from the scene's start, props typed and filled from the schema's defaults (colour tokens resolved for the theme), ctx { fps, frame, width, height, theme, seed, colors }. Draw only from t and props (no timers, Date or Math.random), so any frame renders the same in any order. schema: { title, description, properties }. Both are checked first, and the source must build: a failure leaves the component as it was. Look at it with preview_component.

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": {
      "tag": "<tag>"
    },
    "name": "put_component"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagYes
codeNoThe whole source file
fileNoWhich source file code is (its language); a different one replaces the one there
basisNoWhat you read and followed to make this change, as refs from search or lookup: rule:<lint or taste rule>, taste, feedback:<id> (earlier feedback this follows; what it answers goes in feedback), commit:<id> (an earlier change it builds on), asset:, template:, skill:… The person sees them under the change, so they know why it is this way. Name only what shaped it.
schemaNo{ title, description, properties: { <prop>: { type, default, description, enum?, minimum?, maximum?, x-m3e-animatable?, x-m3e-text? } } }
messageNoOne line saying why, kept with the change in the history
feedbackNoIds of the feedback this change answers (notes and marks from list_notes, list_examples or the conversation). When the person keeps the change it joins the record of that feedback, and when they then mark the feedback resolved it is the fix; when they take it back, the feedback opens again.
confidenceNoHow sure you are this change is what the person wants. high: they asked for exactly this, or you measured it against a reference. medium: you inferred it from the taste, a rule or earlier feedback. low: you are guessing, or it changes something they did not ask about. The person's threshold decides which changes stand by themselves and which wait for them to keep; say it honestly on every change.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.2

TDQS

A4.2/5.0
Behavior4/5

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

Annotations declare it non-destructive and idempotent, and the description goes well beyond that with atomicity semantics: 'Both are checked first, and the source must build: a failure leaves the component as it was.' It also discloses the bundler (esbuild/MOGA), the renderAt contract, and the determinism constraint (no timers, Date, Math.random). It does not mention permissions or any rate/size limits on the code payload, which keeps it off a 5.

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

Conciseness3/5

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

Purpose is front-loaded and the later pointer to preview_component closes the loop, but the middle is a dense run-on of parenthetical clauses and pragma examples. The runtime details earn their place for authoring correct code, yet several sentences pack three or four ideas each and are harder to scan than they need to be.

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

Completeness4/5

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

For an 8-parameter upsert with a nested schema object and no output schema, the description covers the semantics that matter: what gets validated, what happens on failure, and how the authored code will be executed. The provenance params are documented only in the schema, which is adequate given their 88% coverage but is the one remaining gap.

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

Parameters4/5

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

Schema coverage is 88% so the baseline is 3, but the prose adds real meaning beyond the schema: the `file` default resolution rule ('the one there, else .js'), what `code` must export, and the required shape of `schema` and its property fields. The `basis`, `feedback` and `confidence` params are left entirely to the schema, but those schema descriptions are already detailed.

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

Purpose5/5

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

States a specific verb+resource ('Create or replace a project component's source and/or props schema') and pins the on-disk artifacts (components/<tag>/component.<file>, schema.json). An agent can distinguish this upsert from new_component or preview_component purely from the description.

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

Usage Guidelines4/5

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

Clear about when this applies (writing source and/or schema) and routes inspection to preview_component explicitly. It does not state when to prefer new_component or why you would omit `code` versus `schema`, so the create-vs-edit boundary is implied rather than spelled out.

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

Deploy Server

Other Tools