Apply targeted operations (add, modify, remove items/logic/quests) to a room and upload the result. Operations use patch semantics — only specified fields change, everything else is preserved. Automatically pulls fresh room data from the server before applying operations — no need to call get_roo...
AI agents use apply_operations to create or update resources in Portals — usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Portals environment.
| Parameter | Type | Required | Description |
|---|---|---|---|
roomId | string | — | Room ID to update. Falls back to PORTALS_ROOM_ID env variable if omitted. |
feedback | object | Yes | REQUIRED: Structured feedback about this push. Report your confidence AND at least one of: what_worked, guesses, doc_gaps, ambiguity_flags, recipe_requests, or |
filePath | string | — | Optional fallback path to snapshot.json. Fresh data is auto-pulled from the server; this is only used if the pull fails (e.g., brand new room). |
operations | array | Yes | Array of operation objects. Each must have an 'op' key. Positions accept both [x,y,z] arrays and {x,y,z} objects. add_item: {op, type, ...overrides}. Only 'type |
phase_trigger | object | — | Signal a phase transition before this push. Use when the user requested changes (correction) or additions (addition) after a previous push. |
Parameters from the server's own tool schema.
The tool creates and modifies room inventory, logic, and quests in what appears to be a persistent virtual environment. These are reversible Write operations (items and tasks can be added/removed and state can be modified), not irreversible deletions.
From the tool's definition Tool applies 'add, modify, remove' operations to room data and 'uploads the result.' Supports add_item, modify_item, remove_item, add_logic_task, add_quest, add_component operations that create or alter room state reversibly.
Risk signalsAccepts file system path (filePath) · High parameter count (18 properties) · Bulk/mass operation — affects multiple targets
Attacks that exploit this kind of access
Apply targeted operations (add, modify, remove items/logic/quests) to a room and upload the result. Operations use patch semantics — only specified fields change, everything else is preserved. Automatically pulls fresh room data from the server before applying operations — no need to call get_room_data first. Supported ops: add_item, add_item_with_logic, modify_item, remove_item, add_logic_task, clear_logic_tasks, add_quest, remove_quest, add_component. QUICK ADD — all add_item fields except 'type' are optional. Every item type has built-in defaults (pos at correct ground height, default scale/color/etc). Only specify overrides. Examples: {op:'add_item',type:'Cube',color:'FF0000',title:'Red Marker'} — red cube at origin. {op:'add_item',type:'Sphere',color:'55AAFF',physics:true,title:'Blue Physics Sphere'} — ReactGUI resizable sphere. {op:'add_item',type:'Ring',scale:[2,0.4,2],color:'FFAA00',title:'Orange Ring'} — ReactGUI resizable torus/ring. {op:'add_item',type:'Cube',texture:'https://example.com/panel.gif',texture_tiling:2,smoothness:0.8,metallic:0.2,title:'Textured Panel'} — ReactGUI shape texture/material fields. {op:'add_item',type:'Light'} — white light at y=3. {op:'add_item',type:'Spawn'} — default spawn at y=0.2. {op:'add_item',type:'Cube',pos:[5,0.5,3],color:'0000FF',scale:[2,1,1],title:'Blue Wall Section'} — blue 2x1x1 cube at specific pos. {op:'add_item',type:'Cube',physics:true,pushable:true,save_position:true,mass:5.0} — ReactGUI physics cube with player pushing and settled-position persistence. IMPORTANT — pos_space for child items: many items are children of a parent item (parentItemID != 0). Their position (pos) is stored in the parent's local coordinate space, which may be rotated relative to the world. This means setting pos=[0,5,0] does NOT necessarily move the item to world Y=5 — it moves it 5 units along the parent's local Y axis, which could point in any world direction. Use pos_space='world' whenever the user thinks in world/absolute coordinates (e.g. 'move it up 10', 'put it at position 5,0,3'). Use pos_space='local' (default, or omit) only when intentionally positioning relative to the parent's own axes. CROSS-ITEM REFERENCES: Use '__ref:N' (where N is the 0-based operation index) to reference IDs created by earlier add_item or add_item_with_logic operations in the same batch. Example: [{op:'add_item', type:'Cube', pos:[0,1,0]}, {op:'add_logic_task', id:'__ref:0', task:{...}}] — the second op targets the item created by operation 0. It is categorised as a Write tool in the Portals MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
apply_operations accepts 5 parameters: roomId, feedback, filePath, operations, phase_trigger. Required: feedback, operations. The full parameter table on this page comes from the server's own tool schema.
Register the Portals MCP server in PolicyLayer and add a rule for apply_operations: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Portals. Nothing to install.
apply_operations is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the apply_operations rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for apply_operations. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
apply_operations is provided by the Portals MCP server (portals-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
Every MCP server has a record like this.
Type a name, get the same breakdown: verified identity, auth posture, risk grade, capabilities, recommended policy.
Teams ship this data inside their own products. See what a licence covers →