Skip to main content
Glama

ask_ai

Send prompts or conversations to AI models via LightningProx and pay per request in sats; returns replies, tool calls, model used, and remaining balance.

Instructions

Send a prompt or a conversation to an AI model through LightningProx (24 models: Claude, GPT, Gemini, DeepSeek, Mistral and more), paid in sats from your spend token. Returns the reply text, any tool_use blocks, the model used and your remaining balance. Without a spend token it returns a Lightning invoice (L402) for this exact request.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "model": "<model>"
    },
    "name": "ask_ai"
  }
}

Input Schema

NameRequiredDescriptionDefault
l402NoOptional L402 credential 'macaroon:preimage' to pay for this request without a spend token: send the same arguments that produced the invoice, plus this.
modelYesModel ID, e.g. claude-haiku-5-5 (cheap and fast), gpt-4o-mini, gemini-3.8-flash, deepseek-ai/DeepSeek-V4.1-Flash, mistral-small-latest. Call list_models for all IDs.
toolsNoOptional tool definitions in Anthropic format ({name, description, input_schema}), passed through to the model. Tool calls come back as tool_use blocks.
promptNoA single user message. Use this or messages.
systemNoOptional system prompt.
messagesNoAnthropic-format conversation: [{"role":"user"|"assistant","content": string or content blocks}]. Use this or prompt.
max_tokensNoMaximum output tokens (default 1024, max 4096).
tool_choiceNoOptional Anthropic tool_choice, e.g. {"type":"auto"}, {"type":"any"} or {"type":"tool","name":"..."}.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden, and it does substantial work: it discloses the return payload (reply text, tool_use blocks, model used, remaining balance), the two payment modes, and the non-obvious constraint that the L402 retry must resend the identical arguments. It stops short of cost-per-call, rate limits, or error behavior, which keeps it below a 5.

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?

Two front-loaded sentences with no filler: the primary capability comes first and the payment edge case second. The parenthetical list of model families is the only element that could be trimmed since list_models exists, but it usefully signals breadth.

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

Completeness4/5

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

For an eight-parameter, nested-object tool with no annotations and no output schema, the description covers the essentials: what goes in, what comes back, and how payment works, so return-value explanation is not needed. The remaining gap is failure and cost behavior, which an agent would have to discover empirically.

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 eight parameters including the Anthropic-format messages/tools/tool_choice shapes. The description confirms the tool supports tool_use blocks and the L402 credential path but adds little syntax or constraint detail beyond what the schema states, so the baseline 3 applies.

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 opens with a specific verb and resource — 'Send a prompt or a conversation to an AI model' — and names the gateway (LightningProx) and payment mechanism (sats from a spend token). It also names the returned artifacts, so an agent can tell this is the inference call and not the sibling list_models or check_balance.

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?

The payment fallback is spelled out — without a spend token the call returns an L402 invoice for this exact request — which gives real context for the no-credential path. However, it never routes the agent to the siblings that supply prerequisites (get_token, create_topup) and states no when-not-to-use condition, so the guidance is implied rather than explicit.

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

Deploy Server

Other Tools