forcedotcom/sf-skills

experience-content-media-stock-image-search

Searches for and downloads ethically-licensed stock images via the media-management MCP server.

ソースを見る
リポジトリの原文

見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。

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: search_stock_images (server: media-management) Timeout: 30 seconds

ParameterRequiredDefaultNotes
query✅ YesNatural language search phrase (e.g. "sunset over ocean", "business meeting"), max 500 chars
searchTypeNoCreativeCreative (royalty-free stock), Editorial (rights-managed news/event imagery)
orientationNo(none)Horizontal, Vertical, Square, PanoramicHorizontal, PanoramicVertical
sortOrderNoBestMatchBestMatch, MostPopular, Newest
pageSizeNo51–100
pageNo11-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:

FieldNotes
images[]List of results (see item fields below)
totalCountTotal matches across all pages
pageCurrent page (1-indexed)
pageSizeResults per page
searchRequestIdInternal correlation ID. Server-managed; not passed back through the MCP download tool. Safe to surface in debug output if useful.
effectiveQueryKeywords actually sent to the search service. Null if the original query was used unchanged.
errorMessageNon-null if the search failed

Each `images[]` item:

FieldNotes
assetIdStock asset ID — required for download. Safe to display alongside the result if useful.
titleImage title
captionImage description
thumbnailUrlSmall preview URL — use for grid display
previewUrlLarger comp/preview URL — use for tile display
widthMax width in pixels
heightMax height in pixels
licenseModele.g. royaltyfree, rightsmanaged
artistContributor/artist name
collectionCollection name

Step 2 — Present Results, then STOP

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):

text
1. [![<title>](<thumbnailUrl>)](<previewUrl>)
   **<title>** — <artist>, <width>×<height>, <licenseModel>
2. ...

This is standard markdown image-in-link syntax ([![alt](thumbnailUrl)](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.


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).

Before calling `download_stock_image`, verify:

  • [ ] 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: download_stock_image (server: media-management) Timeout: 60 seconds

ParameterRequiredDefaultNotes
assetId✅ YesStock asset ID from the prior search_stock_images result, max 50 chars
sizeNocompcomp (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:

FieldNotes
assetIdStock asset ID that was downloaded
managedContentBodyIdSalesforce record ID where image bytes are stored
parentContentGenAiOutputIdRecord tracking the download request
childContentGenAiOutputIdRecord linking the request to the persisted body
byteCountSize of the persisted image in bytes
formatResolved image format (e.g. jpg, png, eps, tiff, svg)
urlURL to the persisted image — use this to download or preview it

Step 4 — Download to Client and Preview

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.

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 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.


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)
  • managedContentBodyId
  • Attribution: {artist} · {collection} (use the attribution string returned by the download response when present)

Fallbacks & Errors

SituationAction
errorMessage non-null in searchShow it; suggest a simpler query or different searchType/orientation
images emptySuggest broader keywords; try switching Editorial vs Creative
effectiveQuery differsInform user what the search service actually received
MCP tools unavailableUse the placeholder URL below — do not download or save
Download failsShow error; do NOT retry automatically — confirm with user first (each retry is billed)

Placeholder

If search_stock_images and download_stock_image are both unavailable, use this URL directly as src or CSS url():

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.

同じリポジトリから

関連する Skills

すべての Skills
forcedotcom
コミュニティ

agentforce-d360-analyze

Data Cloud 360° view of a single Agentforce session. TRIGGER when user asks to trace, inspect, summarize, or describe a specific Agentforce session by session id (Agent Session UUID 019d… or MessagingSession id 0Mw…). Also triggers on session discovery — find/list/search sessions by time, agent, channel, outcome, or conversation text — when the user has no session id yet. DO NOT TRIGGER for design-time architecture questions (use agentforce-architecture-analyze instead) or for runtime perf/latency/SLO questions that require platform telemetry beyond Data Cloud.

導入数
1
GitHub Stars
972
更新日
9月7日
forcedotcom
コミュニティ

agentforce-generate

Build, modify, audit, repair, optimize, debug, and deploy agents with Agentforce Agent Script. TRIGGER when: user creates, reviews, or changes .agent files or aiAuthoringBundle metadata; asks to fix AgentScript, audit an existing agent, run an AgentScript health check, common-pitfall review, or baseline-versus-candidate repair loop; changes a response, action, subagent, route, state flow, or Agent Spec; previews, debugs, deploys, publishes, or tests agents; uses sf agent generate/preview/publish/test; or manages Agentforce MCP servers, tools, assets, or authentication. DO NOT TRIGGER when: Apex, Flow, Prompt Template, Experience Cloud, or general Salesforce CLI work is unrelated to Agent Script; or the primary input is a production session or trace ID rather than an agent artifact.

導入数
1
GitHub Stars
972
更新日
9月7日
forcedotcom
コミュニティ

platform-quick-deploy

Deploy validated metadata to a Production Salesforce org without re-running tests. TRIGGER when the user wants to deploy to production, says 'quick deploy', 'promote', 'ship to prod', or has just validated and wants to push the change live. REQUIRES a recent sf project deploy validate job ID (≤10 days old, ≤3 days for --use-most-recent). DO NOT TRIGGER for sandbox/scratch deploys (use platform-metadata-deploy) or unvalidated deploys (use platform-deploy-validate first).

導入数
1
GitHub Stars
972
更新日
9月7日
forcedotcom
コミュニティ

agentforce-test

Write, run, and analyze structured test suites for Agentforce agents — functional AND security. TRIGGER when: user writes or modifies test spec YAML (AiEvaluationDefinition); runs sf agent test create, run, run-eval, or results commands; asks about test coverage strategy, metric selection, or custom evaluations; interprets test results or diagnoses test failures; asks about batch testing, regression suites, or CI/CD test integration; requests security testing, OWASP LLM Top 10, red-teaming, penetration testing, prompt-injection tests, a security grade, or a vulnerability assessment of an agent. DO NOT TRIGGER when: user creates, modifies, previews, or debugs .agent files (use agentforce-generate); deploys or publishes agents; writes Agent Script code; uses sf agent preview for development iteration; analyzes production session traces (use agentforce-observe); performs a static safety review of .agent file content (use agentforce-generate Section 15).

導入数
3
GitHub Stars
972
更新日
9月7日