search-assets
Installation
SKILL.md
search_media_library searchQuery
Call search_media_library on DAM with a tight filter. Do not fetch a broad page and filter in code.
Discover fields before you guess
Accounts define arbitrary custom-metadata fields. The user will type normal words ("Nike", "summer campaign", "EMEA", "approved") that may be a field name, a select option, a tag, or only a filename. Never invent "customMetadata.<name>".
For every descriptive word you might put on name or tags:
- Call
list_custom_metadata_fieldsonce. Match the word against each field'sname,label, andschema.selectOptions(case-insensitive). Use the field'sname(notlabel) as"customMetadata.<name>". - Call
list_client_tagswith that word aslabel. If tags come back, filter withtags IN [...]using the returned tagnames verbatim. - Only if neither call matches may you fall back to
name HAS "…". Literal filenames, extensions, and explicitly "named/called/titled X" go onnamewithout this check.
A no-match is cheap: omit that custom-metadata clause rather than guessing a field. Skip filler words ("files", "show me", "assets").
Select types: SingleSelect → = / IN; MultiSelect → IN / NOT IN. Prefer a returned selectOptions value over the user's raw spelling. Text → = : HAS; Number/Date → < <= > >=; Boolean → = with unquoted true/false.