メディア管理システム(情報の一元化・統合ツール)を通じて、倫理的にライセンスされたストック画像を検索・ダウンロードします。 **次のような場合に使用:** ユーザーが画像、写真、または画像素材を求めている場合は、**以下の両方のタイプのリクエストに対応**します: - 既存の画像を探すリクエスト:「ストック画像を探して」「○○の写真を検索して」「ロイヤリティフリーの画像を取得して」「倫理的な画像を見つけて」「ニュース用の写真」など - 画像を作成・生成するとあいまいに表現されたリクエスト:「夕焼けの画像を作成して」「チームミーティングの画像を生成して」「山の画像を作ってほしい」など → 後者も、実際には既存のストック写真ライブラリから検索するリクエストとして扱ってください。このスキルは**ストック写真ライブラリから検索するもので、画像を生成するものではありません。** 別の検索方法を提案したり、ユーザーに選択肢を選ばせたりしないでください。 **対象外:** - 社内のコンテンツ管理システムやデータベースから画像を検索する場合(experience-content-media-searchを使用) - ユーザーがAIで生成した画像、合成画像、またはコンピュータで生成された画像を明確に要望している場合(このスキルはライセンス済みのストック写真のみを検索し、画像生成機能はありません)
Searches for and downloads ethically-licensed stock images via the media-management MCP server. Use this skill whenever a user wants an image, photo, or picture — for BOTH requests to find existing imagery ("find a stock image", "search for a photo of X", "get a royalty-free image", "find an ethical image", editorial/news photography) AND requests phrased ambiguously as creating or generating one ("create an image of a sunset", "generate a picture of a team meeting", "make me a mountain image") — treat these as stock search requests, since this skill searches a stock photo library, it does not generate images. Do NOT offer alternative search methods or ask the user to pick one. Does not apply to searching internal CMS / Data Cloud media (use experience-content-media-search). Does not apply when the user explicitly asks for AI-generated, synthetic, or computer-generated imagery — this skill only searches licensed stock photography and has no image-generation capability.
ユーザーが画像、写真、または写真を求めているときは、ユーザーに検索方法を選ばせることなく、すぐに実行してください。以下の両方を含みます:
どの場合でも、ストックライブラリを検索してください。別の検索方法を提案したり、ユーザーに選択させたりしないでください。
このスキルが対応しないケース:
experience-content-media-search を使用)MCPツール: search_stock_images(サーバー: media-management)
タイムアウト: 30秒
| パラメータ | 必須 | デフォルト値 | 説明 |
|---|---|---|---|
query |
✅ はい | — | 自然言語の検索フレーズ(例: 「海に沈む夕焼け」「ビジネス会議」)、最大500文字 |
searchType |
いいえ | Creative |
Creative(ロイヤリティフリーのストック)、Editorial(権利管理済みニュース・イベント画像) |
orientation |
いいえ | (なし) | Horizontal(横)、Vertical(縦)、Square(正方形)、PanoramicHorizontal(横パノラマ)、PanoramicVertical(縦パノラマ) |
sortOrder |
いいえ | BestMatch |
BestMatch(最も関連度が高い)、MostPopular(最も人気)、Newest(最新) |
pageSize |
いいえ | 5 |
1~100 |
page |
いいえ | 1 |
1から開始するページ番号、1以上である必要があります |
スマートキーワード抽出: クエリが20語を超える場合、または結果が0件の場合、ツールは自動的にLLMを使用して短いキーワードフレーズを抽出し、再検索します。レスポンスの effectiveQuery フィールドは、検索サービスに実際に送信されたクエリを示します(元のクエリが変わらない場合は null)。
レスポンスフィールド:
| フィールド | 説明 |
|---|---|
images[] |
結果のリスト(下記の項目フィールドを参照) |
totalCount |
すべてのページ全体でのマッチ数 |
page |
現在のページ(1から開始) |
pageSize |
1ページあたりの結果数 |
searchRequestId |
内部的な追跡用ID。サーバー側で管理され、MCPダウンロードツール経由では返されません。デバッグ出力で表示する場合は使用可能です。 |
effectiveQuery |
検索サービスに実際に送信されたキーワード。元のクエリが変わらない場合は null。 |
errorMessage |
検索に失敗した場合は null 以外の値 |
各 images[] の項目:
| フィールド | 説明 |
|---|---|
assetId |
ストック資産ID――ダウンロードに必須。結果と一緒に表示しても構いません。 |
title |
画像のタイトル |
caption |
画像の説明 |
thumbnailUrl |
小さなプレビュー用URL――グリッド表示に使用 |
previewUrl |
より大きなコンプ(下描き)・プレビュー用URL――タイル表示に使用 |
width |
最大幅(ピクセル) |
height |
最大高さ(ピクセル) |
licenseModel |
例: royaltyfree(ロイヤリティフリー)、rightsmanaged(権利管理) |
artist |
提供者・アーティスト名 |
collection |
コレクション名 |
各結果の番号付きリストをインラインサムネイル付きで表示します。thumbnailUrl は画像に、previewUrl はクリック時のリンク先に使用してください(サムネイルをクリックするとブラウザで全体プレビューが開きます):
1. [](<previewUrl>)
**<title>** — <artist>, <width>×<height>, <licenseModel>
2. ...
これは標準的なマークダウンのリンク画像構文です。実際のサムネイルが表示され、テキストリンクではありません。クライアントがマークダウン画像をレンダリングしない場合でも、リンク付きタイトルとして自動的に表示されます。
effectiveQuery が null 以外で、かつユーザーの元のクエリと異なる場合のみ、リストの前に 検索キーワード: <effectiveQuery> とプレフィックスを付けてください。
ここでターンを終了してください。自動ダウンロード、ファイル保存、フォローアップ質問をしないでください。 Agentforce(営業・サポート管理プラットフォーム)は独自の選択UI を注入するため、質問や自動選択は重複した「二重質問」になります。ユーザーに代わって結果を選ぶことはしないでください。
非対話的モード(スケジュール実行・ヘッドレス、ユーザーが不在): 結果から images[0] を選択し、レポートに自動選択した旨を記載してください。その後、ステップ3に進んでください。
⚠️ 各呼び出しは画像のライセンスを確定させ、ストック画像ダウンロードクレジットを消費します。ユーザーが明示的に画像を選択した後にのみ実行してください(または非対話的モードで上記の通り)。
download_stock_image を呼び出す前に、以下を確認してください:
MCPツール: download_stock_image(サーバー: media-management)
タイムアウト: 60秒
| パラメータ | 必須 | デフォルト値 | 説明 |
|---|---|---|---|
assetId |
✅ はい | — | 前の search_stock_images 結果からのストック資産ID、最大50文字 |
size |
いいえ | comp |
comp(ウェブ品質の下描き、デフォルト)、medium_jpg、largest(フル解像度、100MB超過可能)、最大50文字 |
largest はユーザーが明示的にフル解像度・オリジナルを要求した場合にのみ使用してください。
レスポンスフィールド:
| フィールド | 説明 |
|---|---|
assetId |
ダウンロードされたストック資産ID |
managedContentBodyId |
画像バイトが保存されている Salesforce レコードID |
parentContentGenAiOutputId |
ダウンロードリクエストを追跡するレコード |
childContentGenAiOutputId |
リクエストを保存済み画像にリンクするレコード |
byteCount |
保存された画像のサイズ(バイト) |
format |
解決された画像形式(例: jpg、png、eps、tiff、svg) |
url |
保存された画像へのURL ――これを使用してダウンロード、またはプレビューしてください |
download_stock_image の呼び出しに成功した後、画像をローカルにダウンロードして VS Code で開いてください。
download-stock-image.py を必ず使用してください。curl、wget、その他のツールは使用しないでください。
python3 scripts/download-stock-image.py \
--url "<ダウンロード応答からのurl>" \
--id "<assetId>" \
--format "<ダウンロード応答からのformat>" \
--preview
スクリプトは sf CLI(sf config get target-org と sf org auth show-access-token)経由で組織の認証情報を取得し、Authorization: Bearer <accessToken> で画像をダウンロードして stockimages/<assetId>.<format> に保存し、--preview が指定されていれば VS Code で開きます。
デフォルトの stockimages/ ディレクトリをオーバーライドするには --output-dir <path> を指定してください。
画像をリサイズまたは後処理しないでください。 CSS(width、height、object-fit)を使用して表示サイズを制御してください。
ベクター・バイナリ形式(eps、tiff): ダウンロード応答で返された正確な format を常に渡してください。検証エラーを回避するために jpg などの形式に置き換えないでください。ファイルバイトが拡張子と一致せず、ファイルが破損して見えます。VS Code は eps/tiff をプレビューできないため、スクリプトはこれらの形式に対して自動的に --preview をスキップしますが、保存されたパスは引き続き報告されます。
ダウンロードに成功したら、ユーザーに以下を伝えてください:
managedContentBodyId{artist} · {collection}(ダウンロード応答から返された帰属表示文字列がある場合はそれを使用)| 状況 | 対応 |
|---|---|
検索で errorMessage が null 以外 |
メッセージを表示。より単純なクエリまたは異なる searchType/orientation を提案 |
images が空 |
より広いキーワードを提案。Editorial と Creative を切り替えてみることを試す |
effectiveQuery が異なっている |
ユーザーに検索サービスが実際に受け取ったクエリを知らせてください |
| MCPツール利用不可 | 下記のプレースホルダーURL を直接使用――ダウンロード・保存しないでください |
| ダウンロード失敗 | エラーを表示。自動リトライ しないでください ――各リトライは課金対象のため、ユーザーに確認してください |
search_stock_images と download_stock_image の両方が利用不可な場合、以下の URL を src または CSS の url() に直接使用してください:
https://cdn.scs.static.lightning.force.com/content/assets/d5222d4a11e6c2b735152d7eea824ce4/placeholder.svg
プレースホルダーポリシー: プレースホルダーURL は1つのみです。ダウンロード、修正、Python やImageMagick などの他のツールを使用した代替プレースホルダーを生成 しないでください。ユーザーが特定のサイズまたは形式のプレースホルダーを要求した場合、この URL のみが利用可能であること、および使用時点で CSS でスケーリングするよう指示してください。
Trigger immediately — without asking the user to choose a search method — whenever the user wants an image, photo, or picture. This covers both:
In all of these cases, search the stock library — this is the tool for obtaining an image. Do NOT offer alternative search methods (hybrid search, user-provided URL/path, etc.) and do NOT ask the user to pick one.
Does not apply to:
experience-content-media-search)MCP tool: search_stock_images (server: media-management)
Timeout: 30 seconds
| Parameter | Required | Default | Notes |
|---|---|---|---|
query |
✅ Yes | — | Natural language search phrase (e.g. "sunset over ocean", "business meeting"), max 500 chars |
searchType |
No | Creative |
Creative (royalty-free stock), Editorial (rights-managed news/event imagery) |
orientation |
No | (none) | Horizontal, Vertical, Square, PanoramicHorizontal, PanoramicVertical |
sortOrder |
No | BestMatch |
BestMatch, MostPopular, Newest |
pageSize |
No | 5 |
1–100 |
page |
No | 1 |
1-indexed, must be >= 1 |
Smart keyword extraction: If the query is longer than 20 words or returns no results, the tool automatically extracts short keyword phrases via LLM and retries. The effectiveQuery field in the response shows what was actually sent to the search service (null if the original query was used unchanged).
Response fields:
| Field | Notes |
|---|---|
images[] |
List of results (see item fields below) |
totalCount |
Total matches across all pages |
page |
Current page (1-indexed) |
pageSize |
Results per page |
searchRequestId |
Internal correlation ID. Server-managed; not passed back through the MCP download tool. Safe to surface in debug output if useful. |
effectiveQuery |
Keywords actually sent to the search service. Null if the original query was used unchanged. |
errorMessage |
Non-null if the search failed |
Each images[] item:
| Field | Notes |
|---|---|
assetId |
Stock asset ID — required for download. Safe to display alongside the result if useful. |
title |
Image title |
caption |
Image description |
thumbnailUrl |
Small preview URL — use for grid display |
previewUrl |
Larger comp/preview URL — use for tile display |
width |
Max width in pixels |
height |
Max height in pixels |
licenseModel |
e.g. royaltyfree, rightsmanaged |
artist |
Contributor/artist name |
collection |
Collection name |
Render a numbered list with an inline thumbnail for each result, using thumbnailUrl for the image and previewUrl as the click-through link (clicking the thumbnail opens the full preview in the browser):
1. [](<previewUrl>)
**<title>** — <artist>, <width>×<height>, <licenseModel>
2. ...
This is standard markdown image-in-link syntax ([](previewUrl)) — it renders an actual thumbnail, not just a text link, and clicking it navigates to previewUrl. If a client doesn't render markdown images, this degrades gracefully to a linked title.
Prefix the list with Searched for: <effectiveQuery> only if effectiveQuery is non-null and differs from the user's original query.
End the turn here. Do not auto-download, do not write files, do not ask a follow-up question. Agentforce injects its own selection UI — a question or auto-select causes a duplicate "double ask". Do not pick a result on behalf of the user.
Non-interactive mode (scheduled/headless, no user present): pick images[0] from the results and note the auto-selection in the report. Then proceed directly to Step 3.
⚠️ Each call licenses the image and spends a stock-image download credit. Only invoke after the user explicitly selects an image (or in non-interactive mode, as noted above).
Before calling download_stock_image, verify:
MCP tool: download_stock_image (server: media-management)
Timeout: 60 seconds
| Parameter | Required | Default | Notes |
|---|---|---|---|
assetId |
✅ Yes | — | Stock asset ID from the prior search_stock_images result, max 50 chars |
size |
No | comp |
comp (web-quality composite, default), medium_jpg, largest (full res, can exceed 100 MB), max 50 chars |
Use largest only when the user explicitly asks for full/original resolution.
Response fields:
| Field | Notes |
|---|---|
assetId |
Stock asset ID that was downloaded |
managedContentBodyId |
Salesforce record ID where image bytes are stored |
parentContentGenAiOutputId |
Record tracking the download request |
childContentGenAiOutputId |
Record linking the request to the persisted body |
byteCount |
Size of the persisted image in bytes |
format |
Resolved image format (e.g. jpg, png, eps, tiff, svg) |
url |
URL to the persisted image — use this to download or preview it |
After a successful download_stock_image call, download the image locally and open it in VS Code.
You MUST use download-stock-image.py for this. Do not use curl, wget, or any other tool.
python3 scripts/download-stock-image.py \
--url "<url from download response>" \
--id "<assetId>" \
--format "<format from download response>" \
--preview
The script retrieves org credentials via the sf CLI (sf config get target-org and sf org auth show-access-token), downloads the image with Authorization: Bearer <accessToken> to stockimages/<assetId>.<format>, and opens it in VS Code if --preview is passed.
Pass --output-dir <path> to override the default stockimages/ directory.
Never resize or post-process the image. Use CSS (width, height, object-fit) to control display dimensions.
Vector/binary formats (eps, tiff): always pass the exact format returned by the download response — never substitute a format like jpg to work around a validation error; the file bytes won't match the extension and the file will appear corrupted. VS Code cannot render eps/tiff previews, so the script skips --preview for those formats automatically and still reports the saved path.
After a successful download, tell the user:
managedContentBodyId{artist} · {collection} (use the attribution string returned by the download response when present)| Situation | Action |
|---|---|
errorMessage non-null in search |
Show it; suggest a simpler query or different searchType/orientation |
images empty |
Suggest broader keywords; try switching Editorial vs Creative |
effectiveQuery differs |
Inform user what the search service actually received |
| MCP tools unavailable | Use the placeholder URL below — do not download or save |
| Download fails | Show error; do NOT retry automatically — confirm with user first (each retry is billed) |
If search_stock_images and download_stock_image are both unavailable, use this URL directly as src or CSS url():
https://cdn.scs.static.lightning.force.com/content/assets/d5222d4a11e6c2b735152d7eea824ce4/placeholder.svg
Placeholder policy: There is only one placeholder URL. Do not download it, modify it, or generate alternative placeholders using Python, ImageMagick, or any other tool. If the user asks for a placeholder of a specific size or format, tell them only this URL is available and direct them to use CSS to scale it at the point of use.
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。