{
  "terminology": "Product terminology: in Uzbek user-facing replies say 'test sinovi' (plural 'test sinovlari'), including 'test sinovi yaratish'; do not call this product feature 'imtihon'. In English use 'quiz', in Russian use 'тест'. Technical identifiers such as create_exam, exam_id and exams:write are compatibility names only: keep them unchanged in tool calls, but describe their meaning using the localized product terms. Preserve user-authored titles and quoted content.",
  "contract_version": "1.0",
  "format": "RichDocument JSON schema_version:1. Markdown, HTML, Mermaid, SVG and remote image URLs are NOT rendered as rich content.",
  "workflow": [
    "Read this guide. Use the exact tools/list schemas; do not wrap tool arguments in Markdown fences.",
    "For images: create an EMPTY bank, obtain real image bytes, upload_image to that bank, then reference the returned id in image.asset_id. Without an image-generation/file tool, explain the limitation; do not fake an image.",
    "Build question body AND option/item bodies as RichDocument objects. Keep answer keys only in answer, never in the visible prompt or alt/caption.",
    "Call validate_question before saving each distinct layout. valid checks structure, not mathematical/pedagogical correctness or image ownership. Review all warnings.",
    "Save using create_question_bank/create_question/update_question with fresh idempotency keys and current revisions. Reuse a key only for an identical retry. Returned authoring_warnings identify suspicious layouts.",
    "For visual QA use create_bank_preview only when the user requests it: the temporary bearer link exposes answers. Existing quiz snapshots are not changed by bank edits."
  ],
  "tables": {
    "rule": "Use type:table with headers=cell[] and rows=row[]. EACH cell is an array of inline nodes, not a string or paragraph. Rectangular, 1-20 columns and 1-20 data rows. Do not draw tables with pipes, dashes, spaces or code blocks.",
    "example": {
      "type": "table",
      "headers": [
        [
          {
            "type": "text",
            "text": "Document"
          }
        ],
        [
          {
            "type": "text",
            "text": "Train"
          }
        ],
        [
          {
            "type": "text",
            "text": "Test"
          }
        ]
      ],
      "rows": [
        [
          [
            {
              "type": "text",
              "text": "D17"
            }
          ],
          [
            {
              "type": "text",
              "text": "yes"
            }
          ],
          [
            {
              "type": "text",
              "text": "yes"
            }
          ]
        ],
        [
          [
            {
              "type": "text",
              "text": "D28"
            }
          ],
          [
            {
              "type": "text",
              "text": "yes"
            }
          ],
          [
            {
              "type": "text",
              "text": "no"
            }
          ]
        ]
      ]
    }
  },
  "formulas": {
    "preferred": "Inline {type:math,latex:...} inside paragraph/list/table cell; display {type:math,latex:...} as a block. Raw LaTeX without dollar delimiters in latex. Double each backslash when writing JSON source (JSON.stringify handles escaping).",
    "serialized_json_example": "{\"type\":\"math\",\"latex\":\"\\\\frac{a}{b}\"}",
    "inline_example": {
      "type": "paragraph",
      "content": [
        {
          "type": "text",
          "text": "Compute "
        },
        {
          "type": "math",
          "latex": "\\frac{a}{b}+x^2"
        }
      ]
    },
    "display_example": {
      "type": "math",
      "latex": "F_1=\\frac{2TP}{2TP+FP+FN}"
    },
    "compatible_text_delimiters": [
      "$...$",
      "$$...$$",
      "\\(...\\)",
      "\\[...\\]"
    ],
    "text_environments": [
      "equation",
      "equation*",
      "align",
      "align*",
      "gather",
      "gather*",
      "multline",
      "multline*"
    ],
    "renderer": "KaTeX primary, restricted MathJax fallback (base, ams, newcommand, bbox, color). Common fractions, powers, roots, sums, Greek letters, matrices and aligned equations work. Not arbitrary LaTeX: no document preamble, usepackage, TikZ, external files, HTML, JS or URL commands. Render complex formulas in preview; syntax validation is not a rendering guarantee. Code blocks/code marks never render math."
  },
  "images": {
    "upload_arguments": {
      "bank_id": "existing bank UUID",
      "mime": "image/png",
      "base64": "actual file bytes encoded as standard base64, without data:image/...;base64, prefix"
    },
    "limits": "MCP: decoded bytes <=1 MiB, encoded string <=1,400,000 characters. PNG/JPEG/WebP only; declared MIME must match file signature. Web upload permits 5 MiB. SVG is unsupported; rasterize diagrams/charts externally first.",
    "image_block": {
      "type": "image",
      "asset_id": "use upload_image response.id (UUID)",
      "alt": "Meaningful description without revealing the answer",
      "caption": "Optional caption"
    },
    "ownership": "Asset must belong to this bank. No base64, local paths, URLs or Markdown image syntax inside the question. Use actual image assets for diagrams/plots; use table blocks for tabular data."
  },
  "text": "Use paragraph/heading/list and text.marks (bold, italic, underline, code). Plain text is literal; **bold**, # headings, Markdown tables and image syntax are not parsed. Code blocks are only for actual code or intentionally literal source examples, not visual layouts.",
  "limits": "Question <=64 KiB UTF-8; 1-64 blocks/document; text<=8000 chars; inline math<=2000; display math<=4000. 2-20 unique-ID options/items. Bulk bank creation <=100 questions; use tools/list for all limits.",
  "complete_question": {
    "schema_version": 1,
    "type": "numeric",
    "topic": "Fractions",
    "difficulty": "easy",
    "points": 1,
    "body": {
      "schema_version": 1,
      "blocks": [
        {
          "type": "paragraph",
          "content": [
            {
              "type": "text",
              "text": "Calculate: "
            },
            {
              "type": "math",
              "latex": "\\frac{6}{3}"
            }
          ]
        }
      ]
    },
    "answer": {
      "value": 2,
      "tolerance": 0,
      "unit": ""
    }
  },
  "question_type_examples": [
    {
      "type": "single_choice",
      "options": [
        {
          "id": "a",
          "body": {
            "schema_version": 1,
            "blocks": [
              {
                "type": "paragraph",
                "content": [
                  {
                    "type": "text",
                    "text": "First"
                  }
                ]
              }
            ]
          }
        },
        {
          "id": "b",
          "body": {
            "schema_version": 1,
            "blocks": [
              {
                "type": "paragraph",
                "content": [
                  {
                    "type": "text",
                    "text": "Second"
                  }
                ]
              }
            ]
          }
        }
      ],
      "answer": {
        "option_id": "a"
      }
    },
    {
      "type": "multiple_choice",
      "options": [
        {
          "id": "a",
          "body": {
            "schema_version": 1,
            "blocks": [
              {
                "type": "paragraph",
                "content": [
                  {
                    "type": "text",
                    "text": "First"
                  }
                ]
              }
            ]
          }
        },
        {
          "id": "b",
          "body": {
            "schema_version": 1,
            "blocks": [
              {
                "type": "paragraph",
                "content": [
                  {
                    "type": "text",
                    "text": "Second"
                  }
                ]
              }
            ]
          }
        }
      ],
      "answer": {
        "option_ids": [
          "a",
          "b"
        ]
      }
    },
    {
      "type": "true_false",
      "answer": {
        "value": true
      }
    },
    {
      "type": "numeric",
      "answer": {
        "value": 2,
        "tolerance": 0.01,
        "unit": "m"
      }
    },
    {
      "type": "short_text",
      "answer": {
        "accepted": [
          "token"
        ],
        "case_sensitive": false
      }
    },
    {
      "type": "open_text",
      "answer": {
        "rubric": "Explain the reasoning; award one point for a correct justification.",
        "grading": "manual"
      }
    },
    {
      "type": "ordering",
      "items": [
        {
          "id": "a",
          "body": {
            "schema_version": 1,
            "blocks": [
              {
                "type": "paragraph",
                "content": [
                  {
                    "type": "text",
                    "text": "First"
                  }
                ]
              }
            ]
          }
        },
        {
          "id": "b",
          "body": {
            "schema_version": 1,
            "blocks": [
              {
                "type": "paragraph",
                "content": [
                  {
                    "type": "text",
                    "text": "Second"
                  }
                ]
              }
            ]
          }
        }
      ],
      "answer": {
        "order": [
          "a",
          "b"
        ]
      }
    },
    {
      "type": "matching",
      "prompts": [
        {
          "id": "p1",
          "body": {
            "schema_version": 1,
            "blocks": [
              {
                "type": "paragraph",
                "content": [
                  {
                    "type": "text",
                    "text": "One"
                  }
                ]
              }
            ]
          }
        },
        {
          "id": "p2",
          "body": {
            "schema_version": 1,
            "blocks": [
              {
                "type": "paragraph",
                "content": [
                  {
                    "type": "text",
                    "text": "Two"
                  }
                ]
              }
            ]
          }
        }
      ],
      "choices": [
        {
          "id": "c1",
          "body": {
            "schema_version": 1,
            "blocks": [
              {
                "type": "paragraph",
                "content": [
                  {
                    "type": "text",
                    "text": "1"
                  }
                ]
              }
            ]
          }
        },
        {
          "id": "c2",
          "body": {
            "schema_version": 1,
            "blocks": [
              {
                "type": "paragraph",
                "content": [
                  {
                    "type": "text",
                    "text": "2"
                  }
                ]
              }
            ]
          }
        }
      ],
      "answer": {
        "pairs": [
          {
            "prompt_id": "p1",
            "choice_id": "c1"
          },
          {
            "prompt_id": "p2",
            "choice_id": "c2"
          }
        ]
      }
    },
    {
      "type": "fill_blank",
      "body": {
        "schema_version": 1,
        "blocks": [
          {
            "type": "paragraph",
            "content": [
              {
                "type": "text",
                "text": "2 + 2 = "
              },
              {
                "type": "blank",
                "id": "b1"
              }
            ]
          }
        ]
      },
      "answer": {
        "blanks": [
          {
            "id": "b1",
            "accepted": [
              "4"
            ]
          }
        ]
      }
    }
  ],
  "examples_note": "question_type_examples supply type-specific fields only. Add schema_version:1, body:RichDocument, topic, difficulty and points to each. Fill-blank uses explicit blank nodes whose IDs match answer.blanks; not underscores or [b1] text."
}
