GetCurrentLocationTool

Returns the device's location from android.location.LocationManager: the freshest cached fix, or — when no provider has one (e.g. a fresh device where no app has asked yet) — a fresh fix requested from every enabled provider at once, bounded by FRESH_FIX_TIMEOUT_MS. Output key source is "cache" or "fresh". Requires ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION. Accepts an accuracy param ("fine" | "coarse", default "coarse") that only reorders the provider preference (GPS/network/fused). Every enabled provider is consulted and the freshest cached fix wins (preference order breaks ties); a SecurityException from one provider (e.g. GPS under a coarse-only grant) just skips it. Output: latitude, longitude, accuracy_meters, altitude, speed_mps, timestamp, provider. Returns ToolResult.error when permission is missing (or every enabled provider refused with a SecurityException), the accuracy value is invalid, or no cached fix exists on any enabled provider.

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 outputSchema: Map<String, Any>
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