experience-content-media-stock-image-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStock Image Search
库存图片搜索
When to Trigger This Skill
触发此技能的时机
Trigger immediately — without asking the user to choose a search method — whenever the user wants an image, photo, or picture. This covers both:
- Finding existing imagery: "find a stock image", "search for a photo of X", "get a royalty-free image", "find an ethical image", editorial or news photography
- Requests phrased ambiguously as creating or generating: "create an image of a sunset", "generate a picture of a team meeting", "make me a mountain image" — treat these as stock search requests; this skill searches a stock photo library, it does not generate images.
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:
- Searching internal CMS / Data Cloud media (use )
experience-content-media-search - Requests that explicitly ask for AI-generated, synthetic, or computer-generated imagery — this skill only searches licensed stock photography and has no image-generation capability
只要用户需要图片、照片,立即触发此技能——无需让用户选择搜索方法。这涵盖以下两种场景:
- 查找现有素材:“找一张库存图片”“搜索X的照片”“获取免版税图片”“找符合伦理的图片”“新闻编辑类摄影图”
- 表述模糊的创建/生成请求:“创建一张日落图片”“生成团队会议的图片”“制作一张山脉图片”——将这些视为库存图片搜索请求;此技能仅搜索库存图片库,不具备图片生成能力。
在所有这些场景下,直接搜索库存图片库——这是获取图片的指定工具。不得提供替代搜索方法(混合搜索、用户提供的URL/路径等),也不得让用户选择搜索方式。
不适用场景:
- 搜索内部CMS/Data Cloud媒体资源(请使用)
experience-content-media-search - 用户明确要求AI生成、合成或计算机生成的图片——此技能仅搜索授权库存摄影图,无图片生成功能
Step 1 — Search
步骤1 — 搜索
MCP tool: (server: )
Timeout: 30 seconds
search_stock_imagesmedia-management| Parameter | Required | Default | Notes |
|---|---|---|---|
| ✅ Yes | — | Natural language search phrase (e.g. "sunset over ocean", "business meeting"), max 500 chars |
| No | | |
| No | (none) | |
| No | | |
| No | | 1–100 |
| No | | 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 field in the response shows what was actually sent to the search service ( if the original query was used unchanged).
effectiveQuerynullResponse fields:
| Field | Notes |
|---|---|
| List of results (see item fields below) |
| Total matches across all pages |
| Current page (1-indexed) |
| Results per page |
| Internal correlation ID. Server-managed; not passed back through the MCP download tool. Safe to surface in debug output if useful. |
| Keywords actually sent to the search service. Null if the original query was used unchanged. |
| Non-null if the search failed |
Each item:
images[]| Field | Notes |
|---|---|
| Stock asset ID — required for download. Safe to display alongside the result if useful. |
| Image title |
| Image description |
| Small preview URL — use for grid display |
| Larger comp/preview URL — use for tile display |
| Max width in pixels |
| Max height in pixels |
| e.g. |
| Contributor/artist name |
| Collection name |
MCP工具:(服务器:)
超时时间:30秒
search_stock_imagesmedia-management| 参数 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|
| ✅ 是 | — | 自然语言搜索短语(如“海上日落”“商务会议”),最多500字符 |
| 否 | | |
| 否 | (无) | |
| 否 | | |
| 否 | | 1–100之间取值 |
| 否 | | 从1开始计数,取值必须≥1 |
智能关键词提取:如果查询语句超过20个单词或未返回结果,工具会通过LLM自动提取短关键词短语并重试。响应中的字段显示实际发送给搜索服务的内容(如果原查询未修改则为)。
effectiveQuerynull响应字段:
| 字段 | 说明 |
|---|---|
| 结果列表(详见下方子项字段) |
| 所有页面的匹配结果总数 |
| 当前页码(从1开始计数) |
| 每页结果数量 |
| 内部关联ID,由服务器管理;不会通过MCP下载工具返回,如需调试可展示。 |
| 实际发送给搜索服务的关键词。如果原查询未修改则为null。 |
| 搜索失败时非空 |
每个子项:
images[]| 字段 | 说明 |
|---|---|
| 库存素材ID——下载时必填,必要时可随结果展示。 |
| 图片标题 |
| 图片描述 |
| 小尺寸预览URL——用于网格展示 |
| 大尺寸预览URL——用于卡片展示 |
| 最大宽度(像素) |
| 最大高度(像素) |
| 许可模式,例如 |
| 贡献者/作者名称 |
| 素材集名称 |
Step 2 — Present Results, then STOP
步骤2 — 展示结果,然后停止
Render a numbered list with an inline thumbnail for each result, using for the image and as the click-through link (clicking the thumbnail opens the full preview in the browser):
thumbnailUrlpreviewUrltext
1. [](<previewUrl>)
**<title>** — <artist>, <width>×<height>, <licenseModel>
2. ...This is standard markdown image-in-link syntax () — it renders an actual thumbnail, not just a text link, and clicking it navigates to . If a client doesn't render markdown images, this degrades gracefully to a linked title.
[](previewUrl)previewUrlPrefix the list with only if is non-null and differs from the user's original query.
Searched for: <effectiveQuery>effectiveQueryEnd 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 from the results and note the auto-selection in the report. Then proceed directly to Step 3.
images[0]使用编号列表展示结果,每个结果内嵌缩略图,用作为图片链接,作为点击跳转链接(点击缩略图在浏览器中打开完整预览):
thumbnailUrlpreviewUrltext
1. [](<previewUrl>)
**<title>** — <artist>, <width>×<height>, <licenseModel>
2. ...这是标准的Markdown图片链接语法()——会渲染实际缩略图而非仅文本链接,点击后跳转到。如果客户端不支持渲染Markdown图片,会自动降级为带链接的标题。
[](previewUrl)previewUrl仅当非空且与用户原查询不同时,在列表前添加。
effectiveQuery搜索关键词:<effectiveQuery>**在此步骤结束交互。不要自动下载、写入文件或提出后续问题。**Agentforce会注入自身的选择UI——额外提问或自动选择会导致重复请求。不得代用户选择结果。
非交互模式(定时/无头模式,无用户参与):从结果中选择,并在报告中注明自动选择,然后直接进入步骤3。
images[0]Step 3 — Download (billed)
步骤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 , verify:
download_stock_image- User has explicitly named or numbered the image they want (or non-interactive mode is confirmed)
- This is not an automatic retry of a previous download
MCP tool: (server: )
Timeout: 60 seconds
download_stock_imagemedia-management| Parameter | Required | Default | Notes |
|---|---|---|---|
| ✅ Yes | — | Stock asset ID from the prior |
| No | | |
Use only when the user explicitly asks for full/original resolution.
largestResponse fields:
| Field | Notes |
|---|---|
| Stock asset ID that was downloaded |
| Salesforce record ID where image bytes are stored |
| Record tracking the download request |
| Record linking the request to the persisted body |
| Size of the persisted image in bytes |
| Resolved image format (e.g. |
| URL to the persisted image — use this to download or preview it |
⚠️ 每次调用都会授权使用图片并消耗库存图片下载额度。仅在用户明确选择图片后(或上述非交互模式下)调用。
调用前需验证:
download_stock_image- 用户已明确指定或编号所需图片(或已确认处于非交互模式)
- 不是之前下载请求的自动重试
MCP工具:(服务器:)
超时时间:60秒
download_stock_imagemedia-management| 参数 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|
| ✅ 是 | — | 来自 |
| 否 | | |
仅当用户明确要求全分辨率/原始尺寸时使用。
largest响应字段:
| 字段 | 说明 |
|---|---|
| 已下载的库存素材ID |
| 存储图片字节的Salesforce记录ID |
| 跟踪下载请求的记录ID |
| 将请求与持久化内容关联的记录ID |
| 持久化图片的字节大小 |
| 解析后的图片格式(如 |
| 持久化图片的URL——用于下载或预览 |
Step 4 — Download to Client and Preview
步骤4 — 下载到客户端并预览
After a successful call, download the image locally and open it in VS Code.
download_stock_imageYou MUST use for this. Do not use , , or any other tool.
download-stock-image.pycurlwgetbash
python3 scripts/download-stock-image.py \
--url "<url from download response>" \
--id "<assetId>" \
--format "<format from download response>" \
--previewThe script retrieves org credentials via the CLI ( and ), downloads the image with to , and opens it in VS Code if is passed.
sfsf config get target-orgsf org auth show-access-tokenAuthorization: Bearer <accessToken>stockimages/<assetId>.<format>--previewPass to override the default directory.
--output-dir <path>stockimages/Never resize or post-process the image. Use CSS (, , ) to control display dimensions.
widthheightobject-fitVector/binary formats (, ): always pass the exact returned by the download response — never substitute a format like to work around a validation error; the file bytes won't match the extension and the file will appear corrupted. VS Code cannot render / previews, so the script skips for those formats automatically and still reports the saved path.
epstiffformatjpgepstiff--preview成功调用后,将图片下载到本地并在VS Code中打开。
download_stock_image必须使用完成此操作,不得使用、或其他工具。
download-stock-image.pycurlwgetbash
python3 scripts/download-stock-image.py \
--url "<下载响应中的url>" \
--id "<assetId>" \
--format "<下载响应中的format>" \
--preview该脚本通过 CLI获取组织凭证(和),使用将图片下载到,如果传入则在VS Code中打开。
sfsf config get target-orgsf org auth show-access-tokenAuthorization: Bearer <accessToken>stockimages/<assetId>.<format>--preview可传入覆盖默认的目录。
--output-dir <路径>stockimages/**不得调整图片大小或进行后期处理。**使用CSS(、、)控制显示尺寸。
widthheightobject-fit矢量/二进制格式(、):必须传入下载响应返回的精确——不得替换为等格式来绕过验证错误,否则文件字节与扩展名不匹配会导致文件损坏。VS Code无法渲染/预览,因此脚本会自动跳过参数,但仍会报告保存路径。
epstiffformatjpgepstiff--previewStep 5 — Report Back
步骤5 — 反馈结果
After a successful download, tell the user:
- Image title and artist
- Local path to the saved image (printed by the script)
managedContentBodyId- Attribution: (use the attribution string returned by the download response when present)
{artist} · {collection}
下载成功后,告知用户:
- 图片标题和作者
- 图片保存的本地路径(由脚本输出)
managedContentBodyId- 署名信息:(如有下载响应返回的署名字符串则使用该字符串)
{artist} · {collection}
Fallbacks & Errors
降级方案与错误处理
| Situation | Action |
|---|---|
| Show it; suggest a simpler query or different |
| Suggest broader keywords; try switching |
| 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) |
| 场景 | 操作 |
|---|---|
搜索响应中 | 展示错误信息;建议使用更简单的查询或更换 |
| 建议使用更宽泛的关键词;尝试切换 |
| 告知用户搜索服务实际接收的关键词 |
| MCP工具不可用 | 使用下方的占位符URL——不得下载或保存 |
| 下载失败 | 展示错误信息;不得自动重试——需先征得用户同意(每次重试都将计费) |
Placeholder
占位符
If and are both unavailable, use this URL directly as or CSS :
search_stock_imagesdownload_stock_imagesrcurl()text
https://cdn.scs.static.lightning.force.com/content/assets/d5222d4a11e6c2b735152d7eea824ce4/placeholder.svgPlaceholder 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.
如果和均不可用,直接使用以下URL作为或CSS :
search_stock_imagesdownload_stock_imagesrcurl()text
https://cdn.scs.static.lightning.force.com/content/assets/d5222d4a11e6c2b735152d7eea824ce4/placeholder.svg占位符规则:仅提供此一个占位符URL。不得下载、修改或使用Python、ImageMagick等工具生成替代占位符。如果用户要求特定尺寸或格式的占位符,告知用户仅提供此URL,并指导他们在使用时通过CSS调整尺寸。