Stock 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
Step 1 — Search
MCP tool: (server:
)
Timeout: 30 seconds
| Parameter | Required | Default | Notes |
|---|
| ✅ Yes | — | Natural language search phrase (e.g. "sunset over ocean", "business meeting"), max 500 chars |
| No | | (royalty-free stock), (rights-managed news/event imagery) |
| 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).
Response 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 |
| 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 |
Step 2 — Present Results, then STOP
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):
text
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
. If a client doesn't render markdown images, this degrades gracefully to a linked title.
Prefix the list with
Searched for: <effectiveQuery>
only if
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
from the results and note the auto-selection in the report. Then proceed directly to Step 3.
Step 3 — Download (billed)
⚠️ 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).
MCP tool: (server:
)
Timeout: 60 seconds
| Parameter | Required | Default | Notes |
|---|
| ✅ Yes | — | Stock asset ID from the prior result, max 50 chars |
| No | | (web-quality composite, default), , (full res, can exceed 100 MB), max 50 chars |
Use
only when the user explicitly asks for full/original resolution.
Response fields:
| Field | Notes |
|---|
| Stock asset ID that was downloaded |
| Salesforce record ID where image bytes are stored |
parentContentGenAiOutputId
| Record tracking the download request |
childContentGenAiOutputId
| 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 |
Step 4 — Download to Client and Preview
After a successful
call, download the image locally and open it in VS Code.
You MUST use for this. Do not use , , or any other tool.
bash
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
CLI (
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
is passed.
Pass
to override the default
directory.
Never resize or post-process the image. Use CSS (
,
,
) to control display dimensions.
Vector/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.
Step 5 — Report Back
After a successful download, tell the user:
- Image title and artist
- Local path to the saved image (printed by the script)
- Attribution: (use the attribution string returned by the download response when present)
Fallbacks & Errors
| Situation | Action |
|---|
| non-null in search | Show it; suggest a simpler query or different / |
| empty | Suggest broader keywords; try switching vs |
| 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) |
Placeholder
If
and
are both unavailable, use this URL directly as
or CSS
:
text
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.