GetSimInfoTool

class GetSimInfoTool(context: Context) : McpTool

Returns SIM card details from android.telephony.TelephonyManager. simSerialNumber (ICCID) needs READ_PHONE_STATE/privileged access and is null on API 29+ for non-privileged apps; SecurityException is caught and yields null. Carrier name and country ISO need no permission. Output: sim_serial (nullable), carrier_name, country_iso, subscription_id (the default subscription's id — TelephonyManager.subscriptionId on API 30+, SubscriptionManager.getDefaultSubscriptionId() below; -1 if none), and slot_index — the physical SIM slot of that subscription (SubscriptionInfo.simSlotIndex, which needs READ_PHONE_STATE, falling back to the permission-free SubscriptionManager.getSlotIndex on API 29+; -1 if unknown).

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