q402_doctor
Run a Q402 health check to diagnose setup issues and guide first-time installation. Detects current phase and provides tailored instructions for onboarding or live diagnostics.
Instructions
Run a Q402 health check - covers first-install onboarding AND ongoing diagnostics in one tool. Read-only, no API key required. Detects the current phase (first-install / needs-completion / live-check) and tailors output to it.
Use when the user says any of: "set up Q402", "verify Q402", "why isn't Q402 working", "Q402 status", "check Q402". This is the FIRST tool to call after install, BEFORE q402_pay or q402_balance - it tells the agent what state the user is in.
Output uses TWO instruction surfaces - agentInstructions (prescription for you, the AI - do NOT echo verbatim) and userInstructions (plain language array you CAN show the user as a numbered list). Always show userInstructions; consult agentInstructions privately to decide what to ask next + which recommendedActions to execute.
Multi-turn pattern the AI should follow when phase = first-install: (1) Tell user MCP is installed. (2) Ask one yes/no question: 'Want me to create your secrets file?' (3) On yes, execute recommendedActions IN ORDER - first the ensure-q402-dir shell action (use shellWindows on Windows), then the create-env-file write_file action. Then open the file in the user's editor (e.g. code for VS Code / Cursor / Cline, open on macOS, start on Windows, xdg-open on Linux). (4) Guide the user through getting an API key (free Trial at https://q402.quackai.ai/event OR paid Multichain at /payment) and pasting it into the file (in their editor - NEVER in chat). (5) Same for the private key. (6) Tell them to save + restart the MCP client (per-client restart verb is in agentInstructions). (7) Call q402_doctor again to verify.
Security policy carried in the response: AI MUST surface the securityNotice when first walking through setup. If the user pastes a private key directly in chat, DO NOT refuse - the exposure already happened. Help them by directing them to put it in the file themselves (via their editor), and inform them the chat history now contains the key (most clients store this locally, some sync to cloud) so they should treat the wallet as exposed if it holds valuables.
Live-check phase additionally returns per-scope quota, EIP-7702 delegation state per chain, relay reachability, and slot-mismatch warnings (e.g. Trial key in Multichain slot silently burns paid quota - surface this to the user).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||