[
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 1,
      "method": "initialize",
      "params": {
        "protocolVersion": "2024-11-05",
        "capabilities": {},
        "clientInfo": {
          "name": "tutorial-test",
          "version": "1"
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 1,
      "result": {
        "protocolVersion": "2024-11-05",
        "capabilities": {
          "tools": {}
        },
        "serverInfo": {
          "name": "tokenba-video-journal",
          "version": "1.0.0"
        }
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 2,
      "method": "tools/list"
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 2,
      "result": {
        "tools": [
          {
            "name": "create_video",
            "description": "Submit once per request_key; repeat returns saved task, unknown submission never retries.",
            "inputSchema": {
              "type": "object",
              "properties": {
                "request_key": {
                  "type": "string",
                  "pattern": "^[a-z0-9-]{1,40}$"
                },
                "prompt": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "request_key",
                "prompt"
              ],
              "additionalProperties": false
            }
          },
          {
            "name": "read_task",
            "description": "Read a task recorded by create_video.",
            "inputSchema": {
              "type": "object",
              "properties": {
                "request_key": {
                  "type": "string"
                }
              },
              "required": [
                "request_key"
              ],
              "additionalProperties": false
            }
          },
          {
            "name": "download_result",
            "description": "Download only the succeeded result of a recorded task; never accept arbitrary URLs.",
            "inputSchema": {
              "type": "object",
              "properties": {
                "request_key": {
                  "type": "string"
                }
              },
              "required": [
                "request_key"
              ],
              "additionalProperties": false
            }
          }
        ]
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 3,
      "method": "tools/call",
      "params": {
        "name": "create_video",
        "arguments": {
          "request_key": "paper-boat-proof",
          "prompt": "Original fictional paper boat gently drifting on a small calm blue pond under warm dawn light, fixed wide camera, continuous simple movement, no people, no words, no watermark added by prompt."
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 3,
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\"reused\": false, \"task_id\": \"task_pMMVl03NRFXyUlIIB92xEtJF8p8eaui3\", \"submission\": \"accepted\"}"
          }
        ]
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 4,
      "method": "tools/call",
      "params": {
        "name": "create_video",
        "arguments": {
          "request_key": "paper-boat-proof",
          "prompt": "Original fictional paper boat gently drifting on a small calm blue pond under warm dawn light, fixed wide camera, continuous simple movement, no people, no words, no watermark added by prompt."
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 4,
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\"reused\": true, \"task_id\": \"task_pMMVl03NRFXyUlIIB92xEtJF8p8eaui3\", \"submission\": \"accepted\"}"
          }
        ]
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 5,
      "method": "tools/call",
      "params": {
        "name": "create_video",
        "arguments": {
          "request_key": "paper-boat-proof",
          "prompt": "different input"
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 5,
      "error": {
        "code": -32000,
        "message": "request_key already belongs to different input"
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 6,
      "method": "tools/call",
      "params": {
        "name": "read_task",
        "arguments": {
          "request_key": "paper-boat-proof"
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 6,
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\"task_id\": \"task_pMMVl03NRFXyUlIIB92xEtJF8p8eaui3\", \"status\": \"pending\", \"usage\": null}"
          }
        ]
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 7,
      "method": "tools/call",
      "params": {
        "name": "read_task",
        "arguments": {
          "request_key": "paper-boat-proof"
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 7,
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\"task_id\": \"task_pMMVl03NRFXyUlIIB92xEtJF8p8eaui3\", \"status\": \"pending\", \"usage\": null}"
          }
        ]
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 8,
      "method": "tools/call",
      "params": {
        "name": "read_task",
        "arguments": {
          "request_key": "paper-boat-proof"
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 8,
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\"task_id\": \"task_pMMVl03NRFXyUlIIB92xEtJF8p8eaui3\", \"status\": \"pending\", \"usage\": null}"
          }
        ]
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 9,
      "method": "tools/call",
      "params": {
        "name": "read_task",
        "arguments": {
          "request_key": "paper-boat-proof"
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 9,
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\"task_id\": \"task_pMMVl03NRFXyUlIIB92xEtJF8p8eaui3\", \"status\": \"running\", \"usage\": null}"
          }
        ]
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 10,
      "method": "tools/call",
      "params": {
        "name": "read_task",
        "arguments": {
          "request_key": "paper-boat-proof"
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 10,
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\"task_id\": \"task_pMMVl03NRFXyUlIIB92xEtJF8p8eaui3\", \"status\": \"running\", \"usage\": null}"
          }
        ]
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 11,
      "method": "tools/call",
      "params": {
        "name": "read_task",
        "arguments": {
          "request_key": "paper-boat-proof"
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 11,
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\"task_id\": \"task_pMMVl03NRFXyUlIIB92xEtJF8p8eaui3\", \"status\": \"running\", \"usage\": null}"
          }
        ]
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 12,
      "method": "tools/call",
      "params": {
        "name": "read_task",
        "arguments": {
          "request_key": "paper-boat-proof"
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 12,
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\"task_id\": \"task_pMMVl03NRFXyUlIIB92xEtJF8p8eaui3\", \"status\": \"running\", \"usage\": null}"
          }
        ]
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 13,
      "method": "tools/call",
      "params": {
        "name": "read_task",
        "arguments": {
          "request_key": "paper-boat-proof"
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 13,
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\"task_id\": \"task_pMMVl03NRFXyUlIIB92xEtJF8p8eaui3\", \"status\": \"running\", \"usage\": null}"
          }
        ]
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 14,
      "method": "tools/call",
      "params": {
        "name": "read_task",
        "arguments": {
          "request_key": "paper-boat-proof"
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 14,
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\"task_id\": \"task_pMMVl03NRFXyUlIIB92xEtJF8p8eaui3\", \"status\": \"running\", \"usage\": null}"
          }
        ]
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 15,
      "method": "tools/call",
      "params": {
        "name": "read_task",
        "arguments": {
          "request_key": "paper-boat-proof"
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 15,
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\"task_id\": \"task_pMMVl03NRFXyUlIIB92xEtJF8p8eaui3\", \"status\": \"succeeded\", \"usage\": {\"total_tokens\": 87300, \"completion_tokens\": 87300}}"
          }
        ]
      }
    }
  },
  {
    "request": {
      "jsonrpc": "2.0",
      "id": 16,
      "method": "tools/call",
      "params": {
        "name": "download_result",
        "arguments": {
          "request_key": "paper-boat-proof"
        }
      }
    },
    "response": {
      "jsonrpc": "2.0",
      "id": 16,
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\"file\": \"paper-boat-proof.mp4\", \"bytes\": 1413501, \"sha256\": \"d635c14be24ee58be6d947b1a727e63c8637058a1d4d2b80724403d0bd95f8f2\", \"task_id\": \"task_pMMVl03NRFXyUlIIB92xEtJF8p8eaui3\"}"
          }
        ]
      }
    }
  }
]
