check_can_message
Verify if a wallet address is capable of receiving XMTP messages by validating its compatibility with the decentralized messaging network.
Instructions
Check if an address can receive XMTP messages
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Wallet address to check |
Implementation Reference
- src/index.ts:410-437 (handler)The handler function for the 'check_can_message' tool. It checks if the XMTP client is connected, extracts the address from args, creates an identifier, calls client.canMessage(), and returns whether the address can receive messages.private async checkCanMessage(args: any) { if (!this.state.client) { throw new Error("XMTP client not connected. Use connect_xmtp tool first."); } const { address } = args; try { // Convert address to proper identifier format const identifier = { identifier: address, identifierKind: 0, // IdentifierKind.Ethereum }; const canMessage = await this.state.client.canMessage([identifier]); return { content: [ { type: "text", text: `Address ${address} can receive XMTP messages: ${canMessage.get(address)}`, }, ], }; } catch (error) { throw new Error(`Failed to check messaging capability: ${error}`); } }
- src/index.ts:180-189 (schema)The input schema for the 'check_can_message' tool, defining a required 'address' string property.inputSchema: { type: "object", properties: { address: { type: "string", description: "Wallet address to check", }, }, required: ["address"], },
- src/index.ts:177-190 (registration)The tool registration in the ListToolsRequestSchema handler, including name, description, and input schema.{ name: "check_can_message", description: "Check if an address can receive XMTP messages", inputSchema: { type: "object", properties: { address: { type: "string", description: "Wallet address to check", }, }, required: ["address"], }, },
- src/index.ts:226-227 (registration)The dispatch case in the CallToolRequestSchema handler that routes calls to the checkCanMessage handler.case "check_can_message": return await this.checkCanMessage(args);