Skip to main content
Glama

llm_query

Route queries to language models based on task complexity. Automatically selects cost-effective models for simple tasks and high-performance models for complex analysis, optimizing for quality and budget.

Instructions

Send a general query to the best available LLM.

Routes by complexity: simple→Haiku/Flash, moderate→Sonnet/GPT-4o, complex→Opus/o3.

Args:
    prompt: The question or prompt to send.
    complexity: Task complexity — "simple", "moderate", or "complex". Drives model
        selection: simple→cheap (Haiku/Flash), moderate→balanced (Sonnet/GPT-4o),
        complex→premium (Opus/o3). Auto-detected from prompt length when omitted.
    model: Explicit model override, bypasses complexity routing entirely.
    system_prompt: Optional system instructions.
    temperature: Sampling temperature (0.0-2.0).
    max_tokens: Maximum output tokens.
    context: Optional conversation context to help the model understand the broader task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes
complexityNo
modelNo
system_promptNo
temperatureNo
max_tokensNo
contextNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden and discloses key behavioral logic: the routing algorithm (complexity→model mapping), auto-detection from prompt length, and model override behavior. Missing cost implications or latency expectations that would be relevant for an LLM API tool.

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?

Well-structured with clear front-loading: one-line summary, routing logic explanation, then Args section. Every sentence adds value; no repetition of schema structure or tautology. The formatting efficiently packs detailed parameter semantics without waste.

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?

For a 7-parameter tool with complex routing logic, the description is complete. Since an output schema exists, the description correctly focuses on input parameters and routing behavior rather than return values. All necessary invocation context is provided.

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

Parameters5/5

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

Given 0% schema description coverage, the description comprehensively compensates by documenting all 7 parameters including data types (temperature range 0.0-2.0), optional vs required semantics, and behavioral triggers (complexity auto-detection, model bypass logic).

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?

Description clearly states the tool 'Send[s] a general query to the best available LLM' with specific verb and resource. The term 'general' effectively distinguishes it from specialized siblings like llm_code, llm_analyze, and llm_audio, positioning it as the default text-generation tool.

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?

Provides excellent internal usage guidance via the complexity routing explanation (simple/moderate/complex mappings), but lacks explicit external guidance comparing when to use this versus specialized siblings (e.g., 'use llm_code for programming tasks'). Usage versus alternatives is only implied by the word 'general'.

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/ypollak2/llm-router'

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