Stock Images
EMCP Tools uses Openverse, the WordPress.org-backed Creative Commons image search, as its stock image source. No API key required (100 req/day anonymous limit, plenty for normal use).
emcp-tools/search-images
Section titled “emcp-tools/search-images”Searches Openverse by keyword.
Input:
query: search termspage_size: results per page, max 20 (default 10)license:cc0,by,by-sa, etc. Defaults to all CC licenses.
Returns: array of { id, title, url, thumbnail, license, creator, source }.
Capability: edit_posts.
emcp-tools/sideload-image
Section titled “emcp-tools/sideload-image”Downloads an external image URL into the WordPress Media Library as an attachment.
Input:
url: external image URL (must be HTTPS, must be an image MIME type)title: optional, defaults to filenamealt: optional, accessibility text
Returns: { attachment_id, url }.
Capability: upload_files.
emcp-tools/add-stock-image
Section titled “emcp-tools/add-stock-image”The composite tool: searches Openverse, sideloads the first matching result, and adds an image widget to a page. One call instead of three.
Input:
query: search termspost_id: target pageparent_id: container to add the widget toposition: child index,-1to appendlicense: optional, defaults to all CC
Returns: { element_id, attachment_id, image_url, attribution }.
Capability: edit_posts + upload_files + ownership check.
Why three tools instead of one
Section titled “Why three tools instead of one”add-stock-image is the convenient path for the AI when it just needs “an image for this hero section.” But sometimes you want the search results without inserting anything (let the AI pick from a list), or you want to sideload a specific external image URL the user provided. The three separate tools cover all three workflows without compromising any of them.
Attribution
Section titled “Attribution”Creative Commons licenses generally require attribution. add-stock-image returns the attribution string but does not automatically add it to the page. That’s the AI’s call based on the prompt. If the AI is building a portfolio page or anywhere attribution matters, ask it to add a small credit caption next to the image.
Wide search queries return better images than narrow ones. “Bakery interior” beats “warm artisan French boulangerie storefront with wooden door at sunset”. Openverse’s index doesn’t have the latter.