facenest_query_photos
Search a local photo library with combined read-only filters for date, place, people, tags, camera, caption, favorites, and photo IDs; returns matching photos without saving an album.
Instructions
READ-ONLY rule query — the same rule engine as a smart album, but NOTHING is saved (no album is created, no 'Allow writes' needed). Use it for every filtered search: a date range, a place, camera/lens, origin, a person, how many people, a tag, caption text, or a pinned id set — and combine rules with match_mode 'all' (AND) / 'any' (OR). Rule shapes (exactly the set the album UI offers): {type:'album', op:'is'|'is_not', album_id:int}; {type:'folder', op:'is'|'is_not'|'under', value:str} (value is the LEAF folder name in original_folder, e.g. '171109', not an absolute/UNC path; under = prefix); {type:'person', op:'is'|'is_not', cluster_id:int} — an unknown cluster_id is rejected with ERR_SMART_PERSON_NOT_FOUND; {type:'tag', op:'has'|'not_has', name:str, source:'any'|'auto'|'manual'} — matching ignores case; call facenest_list_tags first to get real names (auto tags are often Chinese in name, e.g. 狗 / Dog); {type:'date', op:'between'|'on'|'before'|'after'|'this_year'|'this_month'|'last_days', from:'YYYY-MM-DD', to:'YYYY-MM-DD', days:1..3650, sources:['exif'|'ctime'|'mtime'|'upload'] (optional: restrict which date source counts); {type:'place', op:'is'|'is_not', country/admin1/city} — is_not only matches photos that DO have GPS (no location ≠ 'not in Girona'); {type:'photos', op:'in', ids:[…]} to keep a previous result set (e.g. semantic hits) — unknown ids are rejected with ERR_SMART_PHOTOS_UNKNOWN, never silently dropped; {type:'person_count', op:'eq'|'lte'|'gte', n:0..50} — eq/lte 0 means 'no faces at all'; {type:'favorite', op:'is'|'is_not'} — the user's favorite flag; {type:'camera'|'lens', op:'is', value:str} — camera accepts model alone ('iPhone 12 Pro'), make+model ('Apple iPhone 12 Pro') OR just the make ('Apple'), case-insensitive; lens matches by tokens, so 'OnePlus Ace 3' finds 'OnePlus Ace 3 back camera 2147483647mm f/1.8'; {type:'origin', op:'is', value:'photo'|'video_frame'}; {type:'caption', op:'has'|'not_has', text:str, lang:'en'|'zh' (optional)}. Date rules use taken_at (EXIF first, else file time — the date the Dates page shows); add sources:['exif'] when the user means 'actually shot in', not 'dated'. Returns {match_mode, rules, total, images:[{image_id, display_name, thumb_url, thumb_url_abs, taken_at, date_source, shot_at, file_mtime, camera, camera_make, camera_model, lens, …}], groups, group_by, limit, offset, rule_counts, zero_rules, prefix_counts, empty_at}. rule_counts (per-rule counts) and prefix_counts (running AND/OR count) are included automatically when total is 0 — empty_at is the rule index that first drove the intersection to zero, so read them instead of bisecting; pass explain:true to always get them. 1–30 rules; limit max 200; use offset to page; sort 'taken_at'|'uploaded'|'name'; group_by 'none'|'year'|'month'|'place'. Nothing is deleted, moved or created. Every image also has app_url (facenest://photo/<id>). compact:true returns only image_id/display_name/taken_at/thumb_url_abs/app_url/source_path.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"rules": "<rules>"
},
"name": "facenest_query_photos"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | taken_at | |
| limit | No | ||
| rules | Yes | 1–30 rule objects (shapes are listed in the description). | |
| offset | No | ||
| compact | No | Only id/display_name/taken_at/thumb_url_abs/app_url/source_path. | |
| explain | No | Always include per-rule counts (rule_counts / zero_rules). | |
| group_by | No | none | |
| sort_dir | No | desc | |
| match_mode | No | all |