{
  "name": "Chamber Studio",
  "apiVersion": "1.0.0",
  "website": "https://zhang-mengjia.github.io/chamber-studio/",
  "transport": {
    "browser": {
      "global": "window.chamberStudio",
      "call": "await window.chamberStudio.callTool(name, arguments)",
      "ready": "window.chamberStudio?.apiVersion"
    },
    "webmcp": {
      "optional": true,
      "registration": "document.modelContext.registerTool; navigator.modelContext compatibility fallback"
    },
    "http": {
      "mode": "static-discovery-only",
      "note": "GET the discovery files. Tool execution requires an open browser page; there is no remote HTTP POST or hosted MCP endpoint."
    }
  },
  "resources": {
    "documentation": "../ai.html",
    "guide": "./README.md",
    "skill": "../skills/chamber-studio/SKILL.md",
    "schema": "./config.schema.json",
    "discovery": "../llms.txt"
  },
  "coordinates": {
    "walls": [
      "left",
      "right"
    ],
    "columns": 3,
    "rows": 8,
    "origin": "top-left",
    "indexing": "zero-based"
  },
  "modules": {
    "food": {
      "name": "Food port",
      "width": 2,
      "height": 2,
      "states": [
        "empty",
        "full"
      ],
      "defaultState": "empty",
      "options": {
        "flavor": {
          "type": "string",
          "enum": [
            "grain",
            "sucrose",
            "chocolate",
            "banana",
            "strawberry"
          ]
        }
      }
    },
    "water": {
      "name": "Water well",
      "width": 2,
      "height": 2,
      "states": [
        "empty",
        "full"
      ],
      "defaultState": "empty",
      "options": {
        "volume": {
          "type": "integer",
          "enum": [
            10,
            20,
            40,
            80,
            160
          ]
        }
      }
    },
    "nose": {
      "name": "Nose poke",
      "width": 2,
      "height": 1,
      "states": [
        "off",
        "on"
      ],
      "defaultState": "off",
      "options": {}
    },
    "lever": {
      "name": "Lever",
      "width": 2,
      "height": 1,
      "states": [
        "extended",
        "retracted"
      ],
      "defaultState": "extended",
      "options": {}
    },
    "house": {
      "name": "House light",
      "width": 2,
      "height": 1,
      "states": [
        "off",
        "on",
        "flashing"
      ],
      "defaultState": "on",
      "options": {
        "hz": {
          "type": "number",
          "minimum": 0.2,
          "maximum": 5
        }
      }
    },
    "cue": {
      "name": "Cue light",
      "width": 2,
      "height": 1,
      "states": [
        "off",
        "on"
      ],
      "defaultState": "off",
      "options": {}
    },
    "speaker": {
      "name": "Speaker",
      "width": 2,
      "height": 2,
      "states": [
        "silent",
        "playing"
      ],
      "defaultState": "silent",
      "options": {
        "sound": {
          "type": "string",
          "enum": [
            "clicker",
            "siren",
            "white",
            "pure"
          ]
        }
      }
    },
    "camera": {
      "name": "Camera",
      "width": 2,
      "height": 1,
      "states": [
        "off",
        "recording"
      ],
      "defaultState": "off",
      "options": {}
    }
  },
  "rat": {
    "poses": [
      "stand",
      "walk",
      "rear",
      "nose",
      "sit"
    ],
    "legacyPoses": [
      "press",
      "eat"
    ],
    "facing": [
      "left",
      "right"
    ],
    "artwork": "native cubic paths"
  },
  "examples": [
    "reference",
    "dual-water",
    "operant",
    "empty"
  ],
  "formats": [
    "json",
    "svg",
    "png",
    "pdf",
    "pptx"
  ],
  "tools": [
    {
      "name": "chamber_get_capabilities",
      "description": "Read API version, module types, geometry limits, export formats and tool schemas.",
      "inputSchema": {
        "type": "object",
        "properties": {},
        "required": [],
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": true
      }
    },
    {
      "name": "chamber_get_state",
      "description": "Read an independent copy of the current chamber configuration.",
      "inputSchema": {
        "type": "object",
        "properties": {},
        "required": [],
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": true
      }
    },
    {
      "name": "chamber_load_config",
      "description": "Replace the current chamber with a validated configuration. The change can be undone.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "config": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "title": "Chamber Studio version 1 configuration",
            "description": "Zero-based cells: columns 0–2, rows 0–7. Two-row modules occupy their anchor and the row below. Overlaps are rejected at runtime. Rat poses are stand, walk, rear, nose and sit; legacy press/eat normalize to stand. Labels normalize to false.",
            "type": "object",
            "properties": {
              "version": {
                "const": 1
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "floor": {
                "type": "string",
                "enum": [
                  "plain",
                  "bars",
                  "acrylic"
                ]
              },
              "view": {
                "type": "string",
                "enum": [
                  "perspective",
                  "front",
                  "combined"
                ]
              },
              "grid": {
                "type": "boolean"
              },
              "dimensions": {
                "type": "boolean"
              },
              "effects": {
                "type": "boolean"
              },
              "rat": {
                "type": "object",
                "properties": {
                  "pose": {
                    "type": "string",
                    "enum": [
                      "stand",
                      "walk",
                      "rear",
                      "nose",
                      "sit",
                      "press",
                      "eat"
                    ]
                  },
                  "facing": {
                    "type": "string",
                    "enum": [
                      "left",
                      "right"
                    ]
                  },
                  "visible": {
                    "type": "boolean"
                  },
                  "scale": {
                    "type": "number",
                    "minimum": 0.45,
                    "maximum": 1.7
                  },
                  "x": {
                    "type": "number",
                    "minimum": 200,
                    "maximum": 1050
                  },
                  "y": {
                    "type": "number",
                    "minimum": 250,
                    "maximum": 660
                  }
                },
                "required": [
                  "pose",
                  "facing",
                  "scale",
                  "x",
                  "y"
                ],
                "additionalProperties": false
              },
              "labels": {
                "type": "boolean"
              },
              "walls": {
                "type": "object",
                "properties": {
                  "left": {
                    "type": "array",
                    "maxItems": 24,
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 6
                            },
                            "type": {
                              "const": "food"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "empty",
                                "full"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 6
                            },
                            "type": {
                              "const": "water"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "empty",
                                "full"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 7
                            },
                            "type": {
                              "const": "nose"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "off",
                                "on"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 7
                            },
                            "type": {
                              "const": "lever"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "extended",
                                "retracted"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 7
                            },
                            "type": {
                              "const": "house"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "off",
                                "on",
                                "flashing"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 7
                            },
                            "type": {
                              "const": "cue"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "off",
                                "on"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 6
                            },
                            "type": {
                              "const": "speaker"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "silent",
                                "playing"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 7
                            },
                            "type": {
                              "const": "camera"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "off",
                                "recording"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "right": {
                    "type": "array",
                    "maxItems": 24,
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 6
                            },
                            "type": {
                              "const": "food"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "empty",
                                "full"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 6
                            },
                            "type": {
                              "const": "water"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "empty",
                                "full"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 7
                            },
                            "type": {
                              "const": "nose"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "off",
                                "on"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 7
                            },
                            "type": {
                              "const": "lever"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "extended",
                                "retracted"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 7
                            },
                            "type": {
                              "const": "house"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "off",
                                "on",
                                "flashing"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 7
                            },
                            "type": {
                              "const": "cue"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "off",
                                "on"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 6
                            },
                            "type": {
                              "const": "speaker"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "silent",
                                "playing"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "col": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 7
                            },
                            "type": {
                              "const": "camera"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "off",
                                "recording"
                              ]
                            },
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "grain",
                                "sucrose",
                                "chocolate",
                                "banana",
                                "strawberry"
                              ]
                            },
                            "volume": {
                              "type": "integer",
                              "enum": [
                                10,
                                20,
                                40,
                                80,
                                160
                              ]
                            },
                            "hz": {
                              "type": "number",
                              "minimum": 0.2,
                              "maximum": 5
                            },
                            "sound": {
                              "type": "string",
                              "enum": [
                                "clicker",
                                "siren",
                                "white",
                                "pure"
                              ]
                            }
                          },
                          "required": [
                            "col",
                            "row",
                            "type"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "left",
                  "right"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "version",
              "walls",
              "rat"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "config"
        ],
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": false
      }
    },
    {
      "name": "chamber_apply_operations",
      "description": "Apply an ordered batch as one undo step. Add never overwrites a module; a failed operation leaves the entire chamber unchanged. Coordinates are zero-based. Update/remove/move may address either occupied row. Update accepts only options relevant to that module type.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "operations": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "action": {
                      "const": "add"
                    },
                    "wall": {
                      "type": "string",
                      "enum": [
                        "left",
                        "right"
                      ]
                    },
                    "col": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 2
                    },
                    "row": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 7
                    },
                    "type": {
                      "const": "food"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "empty",
                        "full"
                      ]
                    },
                    "flavor": {
                      "type": "string",
                      "enum": [
                        "grain",
                        "sucrose",
                        "chocolate",
                        "banana",
                        "strawberry"
                      ]
                    }
                  },
                  "required": [
                    "action",
                    "wall",
                    "col",
                    "row",
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "action": {
                      "const": "add"
                    },
                    "wall": {
                      "type": "string",
                      "enum": [
                        "left",
                        "right"
                      ]
                    },
                    "col": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 2
                    },
                    "row": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 7
                    },
                    "type": {
                      "const": "water"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "empty",
                        "full"
                      ]
                    },
                    "volume": {
                      "type": "integer",
                      "enum": [
                        10,
                        20,
                        40,
                        80,
                        160
                      ]
                    }
                  },
                  "required": [
                    "action",
                    "wall",
                    "col",
                    "row",
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "action": {
                      "const": "add"
                    },
                    "wall": {
                      "type": "string",
                      "enum": [
                        "left",
                        "right"
                      ]
                    },
                    "col": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 2
                    },
                    "row": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 7
                    },
                    "type": {
                      "const": "nose"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "off",
                        "on"
                      ]
                    }
                  },
                  "required": [
                    "action",
                    "wall",
                    "col",
                    "row",
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "action": {
                      "const": "add"
                    },
                    "wall": {
                      "type": "string",
                      "enum": [
                        "left",
                        "right"
                      ]
                    },
                    "col": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 2
                    },
                    "row": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 7
                    },
                    "type": {
                      "const": "lever"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "extended",
                        "retracted"
                      ]
                    }
                  },
                  "required": [
                    "action",
                    "wall",
                    "col",
                    "row",
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "action": {
                      "const": "add"
                    },
                    "wall": {
                      "type": "string",
                      "enum": [
                        "left",
                        "right"
                      ]
                    },
                    "col": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 2
                    },
                    "row": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 7
                    },
                    "type": {
                      "const": "house"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "off",
                        "on",
                        "flashing"
                      ]
                    },
                    "hz": {
                      "type": "number",
                      "minimum": 0.2,
                      "maximum": 5
                    }
                  },
                  "required": [
                    "action",
                    "wall",
                    "col",
                    "row",
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "action": {
                      "const": "add"
                    },
                    "wall": {
                      "type": "string",
                      "enum": [
                        "left",
                        "right"
                      ]
                    },
                    "col": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 2
                    },
                    "row": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 7
                    },
                    "type": {
                      "const": "cue"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "off",
                        "on"
                      ]
                    }
                  },
                  "required": [
                    "action",
                    "wall",
                    "col",
                    "row",
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "action": {
                      "const": "add"
                    },
                    "wall": {
                      "type": "string",
                      "enum": [
                        "left",
                        "right"
                      ]
                    },
                    "col": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 2
                    },
                    "row": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 7
                    },
                    "type": {
                      "const": "speaker"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "silent",
                        "playing"
                      ]
                    },
                    "sound": {
                      "type": "string",
                      "enum": [
                        "clicker",
                        "siren",
                        "white",
                        "pure"
                      ]
                    }
                  },
                  "required": [
                    "action",
                    "wall",
                    "col",
                    "row",
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "action": {
                      "const": "add"
                    },
                    "wall": {
                      "type": "string",
                      "enum": [
                        "left",
                        "right"
                      ]
                    },
                    "col": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 2
                    },
                    "row": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 7
                    },
                    "type": {
                      "const": "camera"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "off",
                        "recording"
                      ]
                    }
                  },
                  "required": [
                    "action",
                    "wall",
                    "col",
                    "row",
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "action": {
                      "const": "update"
                    },
                    "wall": {
                      "type": "string",
                      "enum": [
                        "left",
                        "right"
                      ]
                    },
                    "col": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 2
                    },
                    "row": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 7
                    },
                    "properties": {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string",
                          "enum": [
                            "empty",
                            "full",
                            "off",
                            "on",
                            "extended",
                            "retracted",
                            "flashing",
                            "silent",
                            "playing",
                            "recording"
                          ]
                        },
                        "flavor": {
                          "type": "string",
                          "enum": [
                            "grain",
                            "sucrose",
                            "chocolate",
                            "banana",
                            "strawberry"
                          ]
                        },
                        "volume": {
                          "type": "integer",
                          "enum": [
                            10,
                            20,
                            40,
                            80,
                            160
                          ]
                        },
                        "hz": {
                          "type": "number",
                          "minimum": 0.2,
                          "maximum": 5
                        },
                        "sound": {
                          "type": "string",
                          "enum": [
                            "clicker",
                            "siren",
                            "white",
                            "pure"
                          ]
                        }
                      },
                      "required": [],
                      "additionalProperties": false,
                      "minProperties": 1
                    }
                  },
                  "required": [
                    "action",
                    "wall",
                    "col",
                    "row",
                    "properties"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "action": {
                      "const": "move"
                    },
                    "from": {
                      "type": "object",
                      "properties": {
                        "wall": {
                          "type": "string",
                          "enum": [
                            "left",
                            "right"
                          ]
                        },
                        "col": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 2
                        },
                        "row": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 7
                        }
                      },
                      "required": [
                        "wall",
                        "col",
                        "row"
                      ],
                      "additionalProperties": false
                    },
                    "to": {
                      "type": "object",
                      "properties": {
                        "wall": {
                          "type": "string",
                          "enum": [
                            "left",
                            "right"
                          ]
                        },
                        "col": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 2
                        },
                        "row": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 7
                        }
                      },
                      "required": [
                        "wall",
                        "col",
                        "row"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "action",
                    "from",
                    "to"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "action": {
                      "const": "remove"
                    },
                    "wall": {
                      "type": "string",
                      "enum": [
                        "left",
                        "right"
                      ]
                    },
                    "col": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 2
                    },
                    "row": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 7
                    }
                  },
                  "required": [
                    "action",
                    "wall",
                    "col",
                    "row"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "action": {
                      "const": "settings"
                    },
                    "settings": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "floor": {
                          "type": "string",
                          "enum": [
                            "plain",
                            "bars",
                            "acrylic"
                          ]
                        },
                        "view": {
                          "type": "string",
                          "enum": [
                            "perspective",
                            "front",
                            "combined"
                          ]
                        },
                        "grid": {
                          "type": "boolean"
                        },
                        "dimensions": {
                          "type": "boolean"
                        },
                        "effects": {
                          "type": "boolean"
                        },
                        "rat": {
                          "type": "object",
                          "properties": {
                            "pose": {
                              "type": "string",
                              "enum": [
                                "stand",
                                "walk",
                                "rear",
                                "nose",
                                "sit",
                                "press",
                                "eat"
                              ]
                            },
                            "facing": {
                              "type": "string",
                              "enum": [
                                "left",
                                "right"
                              ]
                            },
                            "visible": {
                              "type": "boolean"
                            },
                            "scale": {
                              "type": "number",
                              "minimum": 0.45,
                              "maximum": 1.7
                            },
                            "x": {
                              "type": "number",
                              "minimum": 200,
                              "maximum": 1050
                            },
                            "y": {
                              "type": "number",
                              "minimum": 250,
                              "maximum": 660
                            }
                          },
                          "required": [],
                          "additionalProperties": false,
                          "minProperties": 1
                        }
                      },
                      "required": [],
                      "additionalProperties": false,
                      "minProperties": 1
                    }
                  },
                  "required": [
                    "action",
                    "settings"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "required": [
          "operations"
        ],
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": false
      }
    },
    {
      "name": "chamber_load_example",
      "description": "Replace the layout with a bundled example. The change can be undone.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "reference",
              "dual-water",
              "operant",
              "empty"
            ]
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": false
      }
    },
    {
      "name": "chamber_undo",
      "description": "Undo one layout change and return the restored configuration.",
      "inputSchema": {
        "type": "object",
        "properties": {},
        "required": [],
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": false
      }
    },
    {
      "name": "chamber_redo",
      "description": "Redo one layout change and return the restored configuration.",
      "inputSchema": {
        "type": "object",
        "properties": {},
        "required": [],
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": false
      }
    },
    {
      "name": "chamber_export",
      "description": "Export a snapshot of the current chamber. Returns a base64 file by default; download=true triggers a browser download and returns metadata. JSON retains configuration and pose. SVG/PDF retain vector chamber and rat paths; PPTX has editable native shapes grouped by device and rat. PNG scale is 1, 2 or 3. Includes rat artwork attribution.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "format": {
            "type": "string",
            "enum": [
              "json",
              "svg",
              "png",
              "pdf",
              "pptx"
            ]
          },
          "scale": {
            "type": "integer",
            "enum": [
              1,
              2,
              3
            ],
            "default": 2
          },
          "transparent": {
            "type": "boolean",
            "default": true
          },
          "download": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "format"
        ],
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": false
      }
    }
  ]
}
