get_signals
Retrieve scored Solana token alerts with on-chain safety data, market cap, liquidity, holder metrics, and signal strength. Filter by minimum score and recency.
Instructions
Fetch recent trading signals from Pique Signal. Returns scored Solana token alerts with on-chain safety data, market cap, liquidity, holder metrics, and signal strength.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max signals to return (default 10) | |
| min_score | No | Only return signals with score >= this value | |
| since_minutes | No | Look back N minutes (default 60) |
Implementation Reference
- src/tools.js:97-115 (handler)The async handler function for the 'get_signals' tool. It calls api.getRecentAlerts with limit/since_minutes, optionally filters by min_score, and returns the results as JSON.
async ({ limit, min_score, since_minutes }) => { try { const signals = await api.getRecentAlerts({ limit: limit ?? 10, since_minutes: since_minutes ?? 60, }); let filtered = signals; if (min_score !== undefined) { filtered = signals.filter(s => (s.score || 0) >= min_score); } if (filtered.length === 0) { return text('No signals found in the last ' + (since_minutes ?? 60) + ' minutes' + (min_score ? ` with score >= ${min_score}` : '')); } return text(JSON.stringify(filtered, null, 2)); } catch (err) { return error(err.message); } } - src/tools.js:82-89 (schema)Zod input schema for 'get_signals' tool defining optional parameters: limit (1-50), min_score (0-100), since_minutes (1-1440).
{ limit: z.number().int().min(1).max(50).optional() .describe('Max signals to return (default 10)'), min_score: z.number().int().min(0).max(100).optional() .describe('Only return signals with score >= this value'), since_minutes: z.number().int().min(1).max(1440).optional() .describe('Look back N minutes (default 60)'), }, - src/tools.js:79-116 (registration)Registration of the 'get_signals' tool via server.tool() with description, schema, metadata hints, and the handler function.
server.tool( 'get_signals', 'Fetch recent trading signals from Pique Signal. Returns scored Solana token alerts with on-chain safety data, market cap, liquidity, holder metrics, and signal strength.', { limit: z.number().int().min(1).max(50).optional() .describe('Max signals to return (default 10)'), min_score: z.number().int().min(0).max(100).optional() .describe('Only return signals with score >= this value'), since_minutes: z.number().int().min(1).max(1440).optional() .describe('Look back N minutes (default 60)'), }, { title: 'Get Signals', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, async ({ limit, min_score, since_minutes }) => { try { const signals = await api.getRecentAlerts({ limit: limit ?? 10, since_minutes: since_minutes ?? 60, }); let filtered = signals; if (min_score !== undefined) { filtered = signals.filter(s => (s.score || 0) >= min_score); } if (filtered.length === 0) { return text('No signals found in the last ' + (since_minutes ?? 60) + ' minutes' + (min_score ? ` with score >= ${min_score}` : '')); } return text(JSON.stringify(filtered, null, 2)); } catch (err) { return error(err.message); } } ); - src/api-client.js:34-60 (helper)The getRecentAlerts method on PiqueSignalAPI class that fetches recent signals from the /api/alerts/recent endpoint, with rate limiting, authentication, and response sanitization.
async getRecentAlerts({ limit = 10, since_minutes = 60 } = {}) { this.#enforceRateLimit(); const since = new Date(Date.now() - since_minutes * 60_000).toISOString(); const url = new URL('/api/alerts/recent', this.#baseUrl); url.searchParams.set('since', since); url.searchParams.set('limit', String(Math.min(Math.max(1, limit), 50))); const res = await fetch(url.toString(), { headers: { 'Accept': 'application/json', 'Authorization': `Bearer ${this.#apiKey}`, }, signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS), }); if (!res.ok) { const status = res.status; if (status === 401 || status === 403) throw new Error('Authentication failed'); if (status === 429) throw new Error('Rate limited by API'); throw new Error(`API error (${status})`); } const data = await res.json(); const alerts = data.alerts || []; return alerts.map(a => this.#sanitize(a)); }