画像アップロードを準備
prepare_image_uploadの引数、結果スキーマ、OAuth権限、安全注釈を確認済みMCP契約から生成した参考資料です。
このページの目次
ツール
prepare_image_upload
短期限の直接アップロードを準備します。返されたURLとヘッダーで正確にbyte_sizeバイトをPUTし、続けてcomplete_image_uploadを呼びます。
権限と安全
OAuth権限:files:write
| 安全シグナル | 値 |
|---|---|
destructiveHint |
false |
idempotentHint |
false |
openWorldHint |
true |
readOnlyHint |
false |
| spendsCredits | false |
| requiresUserConfirmation | false |
| sideEffects | temporary_upload_created |
注釈は安全上の特性であり、利用者の同意、OAuth認可、サーバー検査の代わりではありません。
入力引数
| フィールド | 型 | 必須 | 既定値 | 制約 | 説明 |
|---|---|---|---|---|---|
byte_size |
integer |
はい | — | exclusiveMinimum: 0 |
Exact number of bytes the client will PUT. |
filename |
string |
はい | — | minLength: 1; maxLength: 240 |
Client filename, not a local path the server can read. |
mime_type |
string |
はい | — | pattern: ^image/(png|jpeg|webp)$ |
Actual image MIME type. |
引数の例
{
"byte_size": 1024,
"filename": "character.png",
"mime_type": "image/png"
}
構造化された結果
| フィールド | 型 | 必須 | 既定値 | 制約 | 説明 |
|---|---|---|---|---|---|
expires_at |
string |
はい | — | format: date-time |
Upload URL expiry. |
headers |
object |
はい | — | — | Exact transfer headers; do not add MCP tokens or API Bearer credentials. |
max_bytes |
integer |
はい | — | — | Maximum accepted upload byte count. |
method |
string |
いいえ | "PUT" |
const: "PUT" |
HTTP method the client must use for the byte transfer. |
upload_id |
string |
はい | — | format: uuid |
Upload session ID for complete_image_upload, not the final file_id. |
upload_url |
string |
はい | — | — | Sensitive short-lived upload URL. Transfer actual bytes; do not publish this URL. |
エラーと次の対応
ツールエラーのerrorにはcode、message、retryable、request_id、detailsがあります。メッセージ本文に依存した分岐や私的入力の漏えいを避けてください。終状態の失敗でも部分成果物を調べます。署名付きURLは保存済みファイルではありません。
この記事は役に立ちましたか?
検索語句、コード、自由記述は収集しません。この設定はドキュメントの操作イベントのみを制御します。 プライバシーポリシー