volt_check_price
Compare AI model pricing across providers to find cost-effective options. Returns sorted results with quality and reliability data for informed decisions.
Instructions
Compare pricing across providers for a given model. Returns offerings sorted by price with quality and reliability data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model name or partial match (e.g. "llama-70b", "gpt-4o", "deepseek") | |
| max_results | No | Maximum number of results to return (default: 5) |
Implementation Reference
- Handler function for the volt_check_price tool.
export function handleCheckPrice(input: CheckPriceInput, feedCache: FeedCache) { const offerings = feedCache.getOfferings(); if (offerings.length === 0) { return { content: [ { type: 'text' as const, text: 'No pricing data available. The feed may still be loading — try again in a moment.', }, ], }; } const matches = comparePrices(offerings, input.model).slice(0, input.max_results); if (matches.length === 0) { return { content: [ { type: 'text' as const, text: `No offerings found matching "${input.model}". Available models: ${getAvailableModels(offerings)}.`, }, ], }; } const rows = matches.map((o, i) => formatOfferingRow(o, i + 1)); const cheapest = matches[0]!; const mostExpensive = matches[matches.length - 1]!; const avgCheapest = (cheapest.priceInputPerMillion + cheapest.priceOutputPerMillion) / 2; const avgExpensive = (mostExpensive.priceInputPerMillion + mostExpensive.priceOutputPerMillion) / 2; const savingsPercent = avgExpensive > 0 ? Math.round(((avgExpensive - avgCheapest) / avgExpensive) * 100) : 0; const header = `Price comparison for "${input.model}" — ${matches.length} offering${matches.length > 1 ? 's' : ''} found`; const footer = matches.length > 1 ? `\nCheapest is ${savingsPercent}% less than most expensive option.` : ''; return { content: [ { type: 'text' as const, text: `${header}\n${'─'.repeat(60)}\n${rows.join('\n')}${footer}`, }, ], }; } - Zod schema for validating volt_check_price tool arguments.
export const checkPriceSchema = z.object({ model: z .string() .describe('Model name or partial match (e.g. "llama-70b", "gpt-4o", "deepseek")'), max_results: z .number() .int() .min(1) .max(20) .default(5) .describe('Maximum number of results to return (default: 5)'), });