Skip to main content
Glama
atriumn
by atriumn

refresh_prices

Force a re-fetch of pricing data from the LiteLLM registry to update stale cache.

Instructions

Force a re-fetch of pricing data from the LiteLLM registry. Use this if you suspect the cached data is stale.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual refreshPrices function that fetches pricing data from the LiteLLM registry, caches it in memory and on disk, and returns the count and timestamp of loaded models.
    export async function refreshPrices(): Promise<{
      count: number;
      timestamp: string;
    }> {
      const models = await fetchFromSource();
      const timestamp = Date.now();
      cache = { timestamp, models };
      saveDiskCache(cache);
      return {
        count: Object.keys(models).length,
        timestamp: new Date(timestamp).toISOString(),
      };
    }
  • src/tools.ts:74-84 (registration)
    The tool registration entry for 'refresh_prices' in the tools array, defining its name, description, and input schema (no parameters required).
      {
        name: "refresh_prices",
        description:
          "Force a re-fetch of pricing data from the LiteLLM registry. Use this if you suspect the cached data is stale.",
        inputSchema: {
          type: "object" as const,
          properties: {},
          required: [],
        },
      },
    ];
  • The executeTool case handler for 'refresh_prices' that calls refreshPrices() and formats the response.
    case "refresh_prices": {
      const result = await refreshPrices();
      return {
        content: [
          {
            type: "text",
            text: `Pricing data refreshed successfully.\nModels loaded: ${result.count}\nTimestamp: ${result.timestamp}`,
          },
        ],
      };
    }
  • Input schema for refresh_prices: an empty object with no required properties.
      inputSchema: {
        type: "object" as const,
        properties: {},
        required: [],
      },
    },
  • src/index.ts:21-28 (registration)
    The MCP server registers the tools via ListToolsRequestSchema handler which returns the tools array, enabling the 'refresh_prices' tool to be listed and called.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
    
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      return executeTool(name, args);
    });
Behavior3/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 indicates a forceful re-fetch operation, implying a potential side effect (updating cache). However, it does not disclose permissions, rate limits, or whether this operation is idempotent or destructive. The description is adequate for a simple tool but lacks deeper behavioral context.

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

Conciseness5/5

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

The description is two sentences, front-loads the action, and every sentence earns its place. There is no unnecessary information, achieving high conciseness for the tool's simplicity.

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

Completeness5/5

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

Given the tool's low complexity (no parameters, no output schema), the description is complete. It explains what the tool does and when to use it, covering all essential information for an agent to select and invoke it correctly.

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

Parameters4/5

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

The tool has zero parameters, so the baseline score is 4. The description does not need to add parameter semantics, and it appropriately focuses on behavior rather than parameters.

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 action ('Force a re-fetch') and the resource ('pricing data from the LiteLLM registry'), making the purpose highly specific. It distinguishes itself from siblings like 'calculate_estimate' and 'get_model_details' which have different purposes.

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

Usage Guidelines4/5

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

The description gives a clear condition for use: 'Use this if you suspect the cached data is stale.' However, it does not explicitly mention when not to use it or name alternatives. Despite this, the condition is actionable and guides the agent effectively.

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/atriumn/tokencost-dev'

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