check_can_message
Verify if a wallet address can receive encrypted messages on the XMTP decentralized messaging network before sending communications.
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 that executes the check_can_message tool. It validates the XMTP client connection, creates an identifier for the given address, calls client.canMessage to check messaging capability, and returns the result as text content.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 definition for the check_can_message tool, specifying a required 'address' string parameter.inputSchema: { type: "object", properties: { address: { type: "string", description: "Wallet address to check", }, }, required: ["address"], },
- src/index.ts:226-228 (registration)The switch case registration that dispatches calls to the check_can_message tool to its handler method.case "check_can_message": return await this.checkCanMessage(args);
- src/index.ts:177-190 (registration)The tool manifest entry in listTools response, 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"], }, },