Skip to main content
Glama

Call a model

ask_model

Run a single paid model inference call via x402 using OpenAI chat messages, capping spend with max_usdg and max_tokens.

Instructions

One paid model call through x402. The price is the upper bound for this request, so keep max_tokens close to what you need. Body is the OpenAI chat format. AGENT_KEY is not set, so this tool will fail until a wallet is configured.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesModel key from list_models
max_usdgNoThe most this call may cost. Default 0.05, never above the spend cap.
messagesYes
max_tokensNoOutput budget you pay for. Default 500.
temperatureNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does reasonably well: it discloses that the operation is paid, that the quoted price is an upper bound, and that the tool will hard-fail without a configured wallet. It omits what happens on failure (whether a failed call is still charged) and any rate/limit behavior, which keeps it out of the top band.

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?

Four short sentences, each carrying a distinct operational fact (payment, price bound, body format, failure precondition), with the paid nature front-loaded. No filler, though the failure warning mid-stream slightly breaks the natural read order.

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?

For a 5-param paid tool with no annotations and no output schema, the description covers cost semantics, request format, and the wallet precondition, but says nothing about what a successful call returns (completion, actual charge, usage). An agent can invoke it, but cannot fully predict the response shape.

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?

Adding meaning beyond the 60%-covered schema: it explains that max_tokens directly drives the price ('keep max_tokens close to what you need') and that the messages body follows the OpenAI chat format, which clarifies the nested message structure. The cost-coupling insight is genuinely not derivable from the schema alone.

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

Purpose4/5

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

States a specific verb+resource ('one paid model call through x402'), which clearly separates it from sibling inference/pricing helpers like quote_inference and list_models. It stops short of naming those siblings explicitly, so the differentiation is implied rather than stated.

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

Usage Guidelines3/5

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

Gives a real precondition ('AGENT_KEY is not set, so this tool will fail until a wallet is configured') and a tuning hint tying max_tokens to cost, which is useful context. However, it never says when to call this versus quote_inference or quote_purchase, so the alternative-routing guidance an agent needs is absent.

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