{
  "version": "1.0.0",
  "kind": "olonjs-page-contract",
  "slug": "libri",
  "title": "Libri",
  "description": "Catalogo libri dimostrativo alimentato da COP collections.",
  "manifestHref": "/mcp-manifests/libri.json",
  "systemPrompt": "You are operating the \"Libri\" page in OlonJS Studio. Use only the declared tools and keep mutations valid against the section schema.",
  "sectionTypes": [
    "footer",
    "books-list"
  ],
  "sectionInstances": [
    {
      "id": "global-footer",
      "type": "footer",
      "scope": "global",
      "label": "footer"
    },
    {
      "id": "books-list-1",
      "type": "books-list",
      "scope": "local",
      "label": "Libri"
    }
  ],
  "sectionSchemas": {
    "footer": {
      "type": "object",
      "required": [
        "brandText",
        "copyright"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "menu": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "label",
              "href"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "href": {
                "type": "string",
                "description": "ui:text"
              },
              "label": {
                "type": "string",
                "description": "ui:text"
              },
              "external": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "description": "ui:list"
        },
        "anchorId": {
          "type": "string",
          "description": "ui:text"
        },
        "brandText": {
          "type": "string",
          "description": "ui:text"
        },
        "copyright": {
          "type": "string",
          "description": "ui:text"
        },
        "legalLinks": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "label",
              "href"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "href": {
                "type": "string",
                "description": "ui:text"
              },
              "label": {
                "type": "string",
                "description": "ui:text"
              },
              "external": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "description": "ui:list"
        },
        "socialLinks": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "label",
              "href"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "href": {
                "type": "string",
                "description": "ui:text"
              },
              "label": {
                "type": "string",
                "description": "ui:text"
              },
              "external": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "description": "ui:list"
        },
        "brandTagline": {
          "type": "string",
          "description": "ui:text"
        }
      },
      "additionalProperties": false
    },
    "books-list": {
      "type": "object",
      "required": [
        "title",
        "items"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "items": {
          "type": "object",
          "description": "ui:collection-ref:libri",
          "additionalProperties": {
            "type": "object",
            "required": [
              "id",
              "title",
              "author",
              "year",
              "genre",
              "summary"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "year": {
                "type": "number",
                "description": "ui:number"
              },
              "genre": {
                "type": "string",
                "description": "ui:text"
              },
              "title": {
                "type": "string",
                "description": "ui:text"
              },
              "author": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "id",
                      "name"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "bio": {
                        "type": "string",
                        "description": "ui:textarea"
                      },
                      "name": {
                        "type": "string",
                        "description": "ui:text"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "$ref"
                    ],
                    "properties": {
                      "$ref": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                ],
                "description": "ui:collection-ref:autori"
              },
              "summary": {
                "type": "string",
                "description": "ui:textarea"
              }
            },
            "additionalProperties": false
          }
        },
        "title": {
          "type": "string",
          "description": "ui:text"
        },
        "eyebrow": {
          "type": "string",
          "description": "ui:text"
        },
        "anchorId": {
          "type": "string",
          "description": "ui:text"
        },
        "pageSize": {
          "type": "number",
          "default": 10,
          "description": "ui:number"
        },
        "description": {
          "type": "string",
          "description": "ui:textarea"
        }
      },
      "additionalProperties": false
    }
  },
  "tools": [
    {
      "name": "update-section",
      "description": "Update a section field in the Studio draft. Does not persist — call save when all updates are complete. Use sectionType to select the matching schema from sectionSchemas.",
      "inputSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "slug": {
            "type": "string",
            "description": "Canonical page slug currently open in Studio."
          },
          "sectionId": {
            "type": "string",
            "description": "Concrete section instance id inside the current draft."
          },
          "sectionType": {
            "type": "string",
            "description": "Section type being updated (for example \"hero\" or \"header\"). Used to select the correct validation schema."
          },
          "scope": {
            "type": "string",
            "enum": [
              "local",
              "global"
            ],
            "default": "local"
          },
          "data": {
            "type": "object",
            "description": "Full replacement payload validated against the schema declared for sectionType."
          },
          "itemPath": {
            "type": "array",
            "description": "Optional root-to-leaf selection path for targeted field mutation.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "fieldKey": {
                  "type": "string"
                },
                "itemId": {
                  "type": "string"
                }
              },
              "required": [
                "fieldKey"
              ]
            }
          },
          "value": {
            "description": "Value written to the final field targeted by itemPath."
          },
          "fieldKey": {
            "type": "string",
            "description": "Shorthand for a top-level scalar field update when itemPath is omitted."
          }
        },
        "required": [
          "sectionId"
        ],
        "oneOf": [
          {
            "required": [
              "data"
            ]
          },
          {
            "required": [
              "itemPath",
              "value"
            ]
          },
          {
            "required": [
              "fieldKey",
              "value"
            ]
          }
        ]
      }
    },
    {
      "name": "save",
      "description": "Persist all pending draft changes using the active save mode (local file, hot save, or save2repo). Call once after all update-section calls are complete.",
      "inputSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {}
      }
    }
  ]
}
