get_sol_price
Retrieve the current SOL/USD exchange rate to monitor Solana token values for trading decisions or wallet management.
Instructions
Get the current SOL/USD price.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/metadata.ts:73-86 (handler)The handler function that executes the get_sol_price tool logic by calling the getSolPrice helper.
export async function handleGetSolPrice(): Promise<string> { try { const price = await getSolPrice(); return JSON.stringify({ success: true, solPriceUsd: price, }); } catch (error) { return JSON.stringify({ success: false, error: error instanceof Error ? error.message : String(error), }); } } - src/services/api.ts:277-280 (helper)Helper function that performs the API request to fetch the SOL/USD price.
export async function getSolPrice(): Promise<number> { const data = await apiGet('/api/solana-price'); return (data.solanaPrice as number) || 0; } - src/tools/metadata.ts:71-71 (schema)Schema definition for the get_sol_price tool.
export const getSolPriceSchema = z.object({});