Package-level declarations

Types

Link copied to clipboard

Fetches full MediaStore metadata for one item by media_id (the media_type param picks image (default) or video). Requires READ_MEDIA_IMAGES/READ_MEDIA_VIDEO on API 33+, else READ_EXTERNAL_STORAGE. Output: id, name, path, date_taken, date_modified, size_bytes, mime_type, width, height, media_type; videos add duration_seconds/resolution, images add latitude/longitude/description (when present).

Link copied to clipboard
class ListAlbumsTool(context: Context) : McpTool

Lists MediaStore buckets (album folders) for images and/or videos, aggregating item counts and using the newest item as the cover. The media_type param selects images (default), videos, or all; results sort by descending item count. Requires READ_MEDIA_IMAGES/READ_MEDIA_VIDEO on API 33+, else READ_EXTERNAL_STORAGE. Output: albums (each {bucket_id, album_name, cover_media_id, count}) capped at the limit param, plus count and media_type.

Link copied to clipboard
object MediaTools

Provider for the MediaStore tools (SearchMediaTool, GetMediaMetadataTool, ListAlbumsTool) covering images and videos.

Link copied to clipboard
class SearchMediaTool(context: Context) : McpTool

Searches the MediaStore for images and/or videos by DISPLAY_NAME substring and/or DATE_TAKEN range, newest-first, with limit/offset paging. The media_type param selects images, videos, or all (default). Requires READ_MEDIA_IMAGES/READ_MEDIA_VIDEO on API 33+, else READ_EXTERNAL_STORAGE. Output: results (each {id, name, path, date_taken, size_bytes, mime_type, width, height, media_type}), count, and media_type.