Skip to main content
Glama

volt_recommend_route

Find optimal AI model providers by comparing cost, latency, and reliability to reduce compute expenses with personalized recommendations.

Instructions

Get the optimal provider recommendation for a model based on cost, latency, reliability, or balanced optimization. Shows savings vs your current cost.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesModel name or partial match to filter offerings (e.g. "llama-70b", "gpt-4o")
optimizeNoWhat to optimize for (default: balanced)balanced
current_cost_per_millionNoWhat you currently pay per million tokens (avg of input+output), for savings estimate
min_qualityNoMinimum acceptable quality score 0-1 (default: 0.7)
max_latency_msNoMaximum acceptable P95 latency in ms (default: 5000)
blocked_providersNoProvider IDs to exclude from recommendations

Implementation Reference

  • Handler for the `volt_recommend_route` tool. It retrieves offerings, filters by model, calculates optimal routing based on the provided profile, and formats the recommendation.
    export function handleRecommendRoute(input: RecommendRouteInput, feedCache: FeedCache) {
      const allOfferings = feedCache.getOfferings();
    
      if (allOfferings.length === 0) {
        return {
          content: [
            {
              type: 'text' as const,
              text: 'No pricing data available. The feed may still be loading — try again in a moment.',
            },
          ],
        };
      }
    
      // Filter to offerings matching the model query
      const query = input.model.toLowerCase();
      const modelOfferings = allOfferings.filter(
        (o) =>
          o.model.toLowerCase().includes(query) || o.modelShort.toLowerCase().includes(query),
      );
    
      if (modelOfferings.length === 0) {
        const available = [...new Set(allOfferings.map((o) => o.modelShort))].slice(0, 10).join(', ');
        return {
          content: [
            {
              type: 'text' as const,
              text: `No offerings found matching "${input.model}". Available models: ${available}.`,
            },
          ],
        };
      }
    
      // Auto-calculate comparison cost from most expensive offering if user didn't provide one
      let currentCost = input.current_cost_per_million;
      let comparisonContext: { autoCalculated: boolean; providerName: string; avgCost: number } = {
        autoCalculated: false,
        providerName: '',
        avgCost: 0,
      };
    
      if (currentCost == null && modelOfferings.length >= 2) {
        let maxAvg = 0;
        let maxProvider = '';
        for (const o of modelOfferings) {
          const avg = (o.priceInputPerMillion + o.priceOutputPerMillion) / 2;
          if (avg > maxAvg) {
            maxAvg = avg;
            maxProvider = o.providerName;
          }
        }
        currentCost = maxAvg;
        comparisonContext = { autoCalculated: true, providerName: maxProvider, avgCost: maxAvg };
      }
    
      const profile: RoutingProfile = {
        optimize: input.optimize as OptimizeTarget,
        minQuality: input.min_quality,
        maxLatencyMs: input.max_latency_ms,
        maxCostPerMillionTokens: Infinity,
        preferredProviders: [],
        blockedProviders: input.blocked_providers,
      };
    
      const rec = generateRecommendation(modelOfferings, profile, currentCost);
    
      if (!rec) {
        return {
          content: [
            {
              type: 'text' as const,
              text: `No eligible offerings for "${input.model}" with your constraints. Try lowering min_quality or raising max_latency_ms.`,
            },
          ],
        };
      }
    
      return {
        content: [
          {
            type: 'text' as const,
            text: formatRecommendation(rec, input.optimize, comparisonContext),
          },
        ],
      };
    }
  • Zod schema for validating the input to the `volt_recommend_route` tool.
    export const recommendRouteSchema = z.object({
      model: z
        .string()
        .describe('Model name or partial match to filter offerings (e.g. "llama-70b", "gpt-4o")'),
      optimize: z
        .enum(['cost', 'latency', 'reliability', 'balanced'])
        .default('balanced')
        .describe('What to optimize for (default: balanced)'),
      current_cost_per_million: z
        .number()
        .nullable()
        .default(null)
        .describe('What you currently pay per million tokens (avg of input+output), for savings estimate'),
      min_quality: z
        .number()
        .min(0)
        .max(1)
        .default(0.7)
        .describe('Minimum acceptable quality score 0-1 (default: 0.7)'),
      max_latency_ms: z
        .number()
        .int()
        .min(100)
        .default(5000)
        .describe('Maximum acceptable P95 latency in ms (default: 5000)'),
      blocked_providers: z
        .array(z.string())
        .default([])
        .describe('Provider IDs to exclude from recommendations'),
    });
  • Registration of the `volt_recommend_route` tool in the MCP server index.
    'volt_recommend_route',
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool 'Shows savings vs your current cost,' which implies a read-only comparison function, but lacks details on permissions, rate limits, data freshness, or what happens if no recommendations match criteria. This is inadequate for a recommendation tool with multiple parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, stating the core purpose in the first sentence and adding a secondary benefit in the second. Both sentences earn their place by clarifying the tool's function and output, with no wasted words or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 parameters, no annotations, no output schema), the description is moderately complete. It covers the primary function and output type but lacks details on behavioral traits, error handling, and result format. Without annotations or output schema, more context on what the recommendation includes would be beneficial for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by hinting at optimization criteria and savings estimation, but does not provide additional syntax, format details, or usage examples for parameters. Baseline 3 is appropriate given high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Get the optimal provider recommendation') and resources ('for a model'), specifying optimization criteria ('based on cost, latency, reliability, or balanced optimization'). It distinguishes from sibling tools like 'volt_check_price' by focusing on recommendations rather than price checks or savings calculations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'volt_check_price' or 'volt_get_savings'. It mentions the tool's function but does not specify scenarios, prerequisites, or exclusions for usage, leaving the agent to infer context from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/newageflyfish-max/volthq'

If you have feedback or need assistance with the MCP directory API, please join our Discord server