Skip to main content
Glama

scene_add_shop

Destructive

Creates a buy-and-sell shop in a copied save from a prefab stall by defining sell and buy lists with items, currencies, prices, and optional stock.

Instructions

Make a prefab a shop (商店) in a copy of a save: the platform's own buying and selling screen, which moves items and currency between the shop and the backpack of the character without any graph. sell lists what the shop sells to the player, buy what it buys from the player; each line is {item, currency, price} with the item and the currency by name or id (scene_add_item, scene_add_currency), and a line of sell may give stock (how many the shop has; 1 when left out, as in the official lesson). prefab is the stall, a prefab from scene_add_prefab. A graph opens the shop for a player with f.openShop(player, the stall entity, 1), in the official lesson when a character enters the stall's collision trigger, and f.closeShop(player) closes it; whenCustomShopItemIsSold (the shop sold something) and whenSellingItemsToTheShop (the player sold something) fire in a graph on the stall. The shop template and the shop component written are byte for byte those of the official sample 货币与商店 (which has one line in each list). Verified in play on 2026-10-11 (examples/shop): the screen shows the shelf on the left with each line's icon, stock and price, and the backpack on the right; a click on a line and on 购买 buys (the currency goes down, the item goes into the backpack, a sold-out line is marked 已售罄); 批量出售, a click on an item of the backpack and 出售 sells at the price of the buy list, not at the item's value. It works on an account of 奇匠 level 1. To play it by script, playtest_start takes click and clickText inputs. Writes a new .gil in the workspace; the official save is not touched.

Input Schema

NameRequiredDescriptionDefault
buyNo
nameYes
sellNo
prefabYes
mapPathNo
outputNameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the annotations, the description discloses that it writes a new .gil in the workspace and leaves the official save untouched, which is important for a destructiveHint=true tool. It also describes runtime behavior, events fired in graphs, and what was verified in playtest, giving the agent substantial behavioral context.

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?

The description is front-loaded with the core purpose and contains useful detail, but it is a single dense paragraph with extended playtest and UI verification notes. Those details add transparency, but the lack of structure and some repetition make it less concise than it could 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 a complex shop-creation tool with nested buy/sell arrays, no output schema, and destructive annotations, the description is largely complete: it explains the write effect, events, graph integration, and playtest behavior. The main remaining gap is that mapPath and outputName are not described, which leaves some operational context unspecified.

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?

With schema description coverage at 0%, the description compensates for some parameters: it explains sell and buy line structure {item, currency, price}, name-or-id item/currency references, the optional stock field defaulting to 1, and that prefab is a stall prefab from scene_add_prefab. However, it does not explain the name, mapPath, or outputName parameters, so parameter semantics remain incomplete.

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?

The description uses a specific verb and resource: make a prefab a shop that provides the platform's buying/selling screen. It distinguishes the tool from data-creation siblings by explaining that the shop moves items and currency without a graph, and it names related tools such as scene_add_item, scene_add_currency, and scene_add_prefab.

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?

The description explains how sell and buy lists are used, what prefab should be, and how a graph opens the shop with f.openShop and closes it with f.closeShop. It gives clear usage context but does not explicitly state when not to use this tool or name a direct alternative for the same outcome.

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