本文へ移動
使い方

ドキュメントを検索

検索はブラウザー内で行われ、入力した語句は送信・保存されません。認証情報は入力しないでください。

検索データを読み込み中…

Tab または矢印キーで移動 · Enter で開く · Esc で閉じる
ドキュメントを探す

画像アップロードを準備

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.

引数の例

json
{
  "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.

McpUploadPrepareOutput

エラーと次の対応

ツールエラーのerrorにはcode、message、retryable、request_id、detailsがあります。メッセージ本文に依存した分岐や私的入力の漏えいを避けてください。終状態の失敗でも部分成果物を調べます。署名付きURLは保存済みファイルではありません。

標準ワークフロー · 支出保護

この記事は役に立ちましたか?

検索語句、コード、自由記述は収集しません。この設定はドキュメントの操作イベントのみを制御します。 プライバシーポリシー

お困りですか?サポートへ