web3_list_keys
Lists all API keys for a wallet using a SIWE signed message. Returns key IDs, prefixes, active status, and last usage timestamps.
Instructions
List all API keys for a wallet. Requires a fresh SIWE challenge signed with personal_sign. Returns key IDs, prefixes, active status, and last usage timestamps.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | The SIWE message from web3_challenge | |
| signature | Yes | Hex-encoded signature from personal_sign (0x-prefixed, 65 bytes) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Result data object |
Implementation Reference
- src/index.ts:2156-2193 (handler)The 'web3_list_keys' tool registration and handler. It calls api().web3.listKeys() if a client is configured, otherwise makes a direct POST to https://api.0xarchive.io/v1/web3/keys. Accepts 'message' and 'signature' params, returns API key list.
server.registerTool( "web3_list_keys", { description: "List all API keys for a wallet. Requires a fresh SIWE challenge signed with personal_sign. " + "Returns key IDs, prefixes, active status, and last usage timestamps.", inputSchema: { message: z.string().describe("The SIWE message from web3_challenge"), signature: z.string().describe("Hex-encoded signature from personal_sign (0x-prefixed, 65 bytes)"), }, outputSchema: ObjectOutputSchema, annotations: AUTH_TOOL_ANNOTATIONS, }, async (params: any) => { try { if (client) { const data = await api().web3.listKeys(params.message, params.signature); return formatResponse(data); } const response = await fetch("https://api.0xarchive.io/v1/web3/keys", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ message: params.message, signature: params.signature }), }); const data = await response.json(); if (!response.ok) { return { content: [{ type: "text" as const, text: `Error: ${data.error || "List keys failed"}` }], isError: true, }; } return formatResponse(data); } catch (err) { const error = err instanceof OxArchiveError ? err : new OxArchiveError(String(err), 500); return formatError(error); } } ); - src/index.ts:2065-2070 (registration)Annotations used for web3 auth tools (web3_list_keys, web3_challenge, web3_signup, etc.) declaring they are not read-only, not destructive, not idempotent, and open world.
const AUTH_TOOL_ANNOTATIONS = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true, } as const; - src/index.ts:2157-2168 (schema)Input/output schema for web3_list_keys: requires 'message' (SIWE challenge message) and 'signature' (hex-encoded personal_sign signature), outputs an object via ObjectOutputSchema.
"web3_list_keys", { description: "List all API keys for a wallet. Requires a fresh SIWE challenge signed with personal_sign. " + "Returns key IDs, prefixes, active status, and last usage timestamps.", inputSchema: { message: z.string().describe("The SIWE message from web3_challenge"), signature: z.string().describe("Hex-encoded signature from personal_sign (0x-prefixed, 65 bytes)"), }, outputSchema: ObjectOutputSchema, annotations: AUTH_TOOL_ANNOTATIONS, },