ReadNfcTagTool

class ReadNfcTagTool(context: Context) : McpTool

Reads NDEF data from the most recently scanned NFC tag.

Does not actively scan: it returns the tag cached in NfcTagCache, which the host Activity populates from onNewIntent() via NFC foreground dispatch. Requires NFC to be available and enabled. Read-only.

Output keys: has_tag; when a tag is cached, tag_id (hex), is_ndef, and tech_list (non-NDEF tags) or is_ndef/max_size/is_writable/records (each record: tnf, type, payload). When no tag is cached: has_tag false plus a message.

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