Skip to main content
Glama
edlovesjava

mcp-api-bridge

by edlovesjava

understand_query

Turn a natural-language query into an inspectable search plan of keywords, filters, sort, and synonyms, using only the catalog's available vocabulary.

Instructions

Turn a natural-language query into a structured search plan, without searching.

Uses Bedrock to split a shopper's phrasing into keywords, structured filters, a sort, and synonyms — restricted to the vocabulary the target catalog actually exposes. Use this when you want to inspect or adjust the plan before running it; use smart_search to do both at once.

Args: query: The user's request, in their own words. api: Which catalog's vocabulary to plan against. Optional when only one is configured.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiNo
queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiYes
planYes
model_idYes
original_queryYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.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 behavioral burden itself. It discloses that the tool does not search, that it uses Bedrock, and that it restricts output to the target catalog's exposed vocabulary by splitting into keywords, filters, sort, and synonyms. It does not mention potential failure modes or permissions, but for a planning-only tool the behavior is transparent enough to set correct expectations.

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 compact and front-loaded: the core purpose and key non-behavior ('without searching') appear in the first sentence. The usage note, behavior summary, and parameter explanations each add distinct value with no redundant filler.

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 two-parameter planning tool with an output schema, the description covers purpose, usage, behavior, and parameters sufficiently. It could add how to know valid `api` values when multiple catalogs are configured, but the sibling `list_catalogs` likely covers that, and the description already notes the optional case.

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?

Schema description coverage is 0%, so the description must define both parameters itself. It does so clearly: `query` is 'The user's request, in their own words,' and `api` is 'Which catalog's vocabulary to plan against. Optional when only one is configured.' This adds real meaning beyond the bare schema types and even explains the optionality condition.

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-plus-resource statement: 'Turn a natural-language query into a structured search plan, without searching.' It also distinguishes itself from the sibling `smart_search` by noting the split between planning and executing, so an agent can clearly tell when this tool is the right one.

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

Usage Guidelines5/5

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

Explicit usage guidance is provided: 'Use this when you want to inspect or adjust the plan before running it; use `smart_search` to do both at once.' This names the alternative and gives the conditional that selects this tool over it, leaving no ambiguity about when to call it.

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