GetMediaMetadataTool

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

latitude/longitude are only queried below API 29: since Q, MediaProvider rejects those columns in a normal projection (IllegalArgumentException: Invalid column latitude) unless the caller holds ACCESS_MEDIA_LOCATION — which this SDK doesn't request, consistent with modules never requesting permissions themselves. Including them unconditionally previously broke the entire query (not just those two fields) on every image lookup on API 29+.

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard
open override val annotations: ToolAnnotations
Link copied to clipboard
open override val description: String
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val parameters: List<ToolParameter>

Functions

Link copied to clipboard
open suspend override fun execute(params: Map<String, Any>): ToolResult