On this page
Part-registry and part-export MCP tools: mutate the registry and broadcast state, and surface read-only export validation problems as structured dicts.
#server.src.pixelweaver.mcp_part_tools
#server.src.pixelweaver.mcp_part_tools
Part-registry + part-export MCP tools (G8/G11).
Mutating handlers follow the frame/part-set sequence: validate -> mutate server state (project.set_part_registry) -> dispatch the frontend command -> broadcast the full state (the partRegistry snapshot key carries the change to clients). Export handlers are read-only and surface validation problems as structured dicts.
#_part_registry_undo_record
def _part_registry_undo_record(before: list[dict[str, Any]], after: list[dict[str, Any]]) -> dict[str, Any]Build a meta-snapshot undo record for a part-registry replacement.
Mirrors metadata_ops' part-registry record shape so MCP undo/redo revert the registry via the shared meta_snapshot handler.
#register_part_tools
def register_part_tools(registry: MCPCommandRegistry) -> NoneRegister part-registry + part-export MCP tools.