register_trial
Sign up for a 30-day free trial of QuantToGo trading signals by providing your email to receive an API key for real-time buy/sell signals across all strategies.
Instructions
Register for a free 30-day trial of QuantToGo trading signals. Provide your email to get an API key for accessing real-time buy/sell signals across all strategies. Idempotent — calling again with the same email returns the existing account. A confirmation email with your credentials will also be sent.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | Your email address for registration and credential recovery |
Implementation Reference
- src/index.ts:326-380 (handler)The register_trial tool handler that calls the API to register a user for a free 30-day trial. It takes an email parameter, calls the 'registerTrial' API endpoint, and returns the API key, invite code, status, and trial end date.
server.tool( "register_trial", "Register for a free 30-day trial of QuantToGo trading signals. Provide your email to get an API key for accessing real-time buy/sell signals across all strategies. Idempotent — calling again with the same email returns the existing account. A confirmation email with your credentials will also be sent.", { email: z.string().email().describe("Your email address for registration and credential recovery"), }, async ({ email }) => { const res = (await callAPI("registerTrial", { email, source: "mcp" })) as { code: number; message: string; data?: { apiKey: string; inviteCode: string; status: string; trialEnd: string; alreadyRegistered: boolean; }; }; if (res.code !== 0 || !res.data) { return { content: [ { type: "text" as const, text: res.message || "Registration failed. Please try again or contact admin@quanttogo.com.", }, ], }; } const d = res.data; const result = { apiKey: d.apiKey, inviteCode: d.inviteCode, status: d.status, trialEnd: d.trialEnd, alreadyRegistered: d.alreadyRegistered, nextSteps: { getSignals: `Call get_signals with apiKey="${d.apiKey}" and a productId from list_strategies`, checkStatus: `Call check_subscription with apiKey="${d.apiKey}" to check your trial status`, webLogin: `Use invite code ${d.inviteCode} at https://www.quanttogo.com`, }, important: "Save your API key — you'll need it for future sessions.", }; return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2), }, ], }; } ); - src/index.ts:329-331 (schema)Input schema for register_trial tool using Zod validation. Defines a single 'email' field that must be a valid email address.
{ email: z.string().email().describe("Your email address for registration and credential recovery"), }, - src/index.ts:11-19 (helper)The callAPI helper function used by register_trial to make HTTP POST requests to the QuantToGo API endpoints.
async function callAPI(fn: string, body: Record<string, unknown> = {}): Promise<unknown> { const resp = await fetch(`${API_BASE}/${fn}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body), }); if (!resp.ok) throw new Error(`API ${fn} returned ${resp.status}`); return resp.json(); }