x402_sentiment
Analyze cryptocurrency sentiment using social media, news, and market data to generate sentiment scores and confidence levels for specific coins.
Instructions
Get real-time crypto sentiment analysis for a specific coin. Price: $0.01 USDC per query.
Analyzes social media, news, and market data to produce sentiment scores. Without X402_PRIVATE_KEY, only the free test endpoint is available.
Returns: sentiment score (-1 to 1), confidence, sources, and analysis.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | Cryptocurrency ticker symbol (e.g., 'BTC', 'ETH', 'SOL') |
Implementation Reference
- src/index.ts:375-390 (handler)The handler implementation for the x402_sentiment tool, which fetches sentiment data from either a paid or free endpoint based on the availability of a private key.
async (params) => { const base = APIS.sentiment.baseUrl; try { const usePaid = !!PRIVATE_KEY; const endpoint = usePaid ? `/sentiment/${params.coin.toLowerCase()}` : `/test/sentiment/${params.coin.toLowerCase()}`; const data = await apiGet(base, endpoint, usePaid); return textResult({ mode: usePaid ? "paid" : "free_test", cost: usePaid ? "$0.01" : "free", coin: params.coin.toUpperCase(), ...data, }); - src/index.ts:358-374 (registration)Registration of the x402_sentiment tool, including its description and input schema using Zod.
server.tool( "x402_sentiment", `Get real-time crypto sentiment analysis for a specific coin. Price: $0.01 USDC per query. Analyzes social media, news, and market data to produce sentiment scores. Without X402_PRIVATE_KEY, only the free test endpoint is available. Returns: sentiment score (-1 to 1), confidence, sources, and analysis.`, { coin: z .string() .regex(/^[A-Z0-9]{1,10}$/i) .describe( "Cryptocurrency ticker symbol (e.g., 'BTC', 'ETH', 'SOL')" ), },