Skip to main content
Glama

ai_query_expand

Read-only

Search query expander (RAG) — Turns one search query into better retrieval input for web search, vector search and RAG: intent, n alternative rewrites (n=2-8, default 5), core keywords with synonyms, sub-questions, a HyDE passage to embed, a ready boolean query ((a OR b) AND c), inferred filters, and all_queries for parallel search + rank fusion. Optional domain= (e.g. legal, medical, ecommerce). Price: $0.005 USDC (Base, via x402).

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": {
      "q": "<q>"
    },
    "name": "ai_query_expand"
  }
}

Input Schema

NameRequiredDescriptionDefault
qYese.g. how do I lower my AWS bill

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?

Annotations already cover the safety profile (readOnlyHint, destructiveHint=false, openWorldHint), and the description adds genuinely non-obvious behavior: the tool returns multiple distinct artifacts, and it costs $0.005 USDC via x402 on Base, which an agent must know before calling. Since no output schema exists, describing the returned artifacts here is the only disclosure channel; only rate limits and failure modes are left unaddressed.

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 purpose and scope are front-loaded in the first clause, and every subsequent item is a concrete output or constraint rather than filler. It is dense to the point of being crammed with parentheticals, but no sentence is expendable.

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 a single-parameter transformation tool with no output schema, the description carries the return-value burden well by listing every artifact produced, plus cost and an optional domain hint. The remaining gap is the undocumented 'n' and 'domain' parameters relative to the supplied schema.

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 coverage is 100% for the single required 'q' parameter, so the baseline is 3. The description adds meaning through examples of the outputs, but it also references parameters not present in the schema ('n=2-8, default 5' and 'Optional domain='), which an agent could wrongly attempt to pass; that inconsistency offsets the added detail rather than improving it.

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?

Names a specific verb and resource ('Search query expander (RAG)') and immediately states the transformation: one query into retrieval input. It enumerates concrete artifacts (intent, n rewrites, keywords, sub-questions, HyDE passage, boolean query, filters, all_queries), so an agent can tell this is a query-rewriting tool, not a search or embedding 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?

Gives usage context ('better retrieval input for web search, vector search and RAG' plus a 'domain=' example), which implies when to reach for it. However, it never states when NOT to use it or names any alternative sibling (e.g. embed, ai_ask, ai_embed) for the cases where a plain search or embedding is enough, so routing is only implied.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources