Skip to main content
Glama

Search merchants

search_merchants
Read-only

Search the merchant directory

Take the row whose merchant_name is the brand.

Ranks canonical merchants whose descriptors match q by the recent volume of those matching descriptors. merchant_name is the merchant's canonical name; the raw descriptor that matched is returned as sample_descriptor. The volume fields are the merchant's whole recent volume (every descriptor, sub-brand and merged id), with the matching part in matched_txn_count.

The window is days long and ends on coverage.observed_through, the last day every source has delivered, so its volumes come from every source and match a spend total over the same days. start_date and end_date give the window. A lagged key whose freshness cutoff covers the whole lookback receives an empty result with clamped rather than an error.

Not a first step: the spend tools take a brand by name. Search only when a name comes back ambiguous, not found, or matched_by descriptor. Then search once, take the row whose merchant_name is the brand, and pass its merchant_id.

Talk to the user in plain words: no tool, parameter or field names. Say "the American Spend model", never "panel" or a data source.

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": "search_merchants"
  }
}

Input Schema

NameRequiredDescriptionDefault
qYesSearch term, 2–100 characters.
daysNoLookback window in days.
limitNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare it is a safe read; the description adds ranking behavior, the fact that the window ends on `coverage.observed_through` so volumes are cross-source comparable, and the non-obvious failure mode where a lagged key receives an empty result with `clamped` rather than an error. That is exactly the kind of behavior an agent cannot infer from readOnlyHint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and the when-not-to-use rule are front-loaded, which is good, but "Take the row whose merchant_name is the brand" is stated twice in near-identical wording, and the closing paragraph about talking to the user in plain words is style guidance rather than tool-selection information. It also references `start_date` and `end_date`, which are not parameters here and could momentarily confuse an agent.

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?

There is no output schema, so the description must carry the return contract, and it does: `merchant_name`, `sample_descriptor`, whole-recent-volume fields, `matched_txn_count`, and the `clamped` empty-result case. For a three-parameter search tool, nothing an agent needs in order to call it or read its result is missing.

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?

Schema coverage is 67%, and the description meaningfully extends two parameters: `q` is defined by what it matches (descriptors of canonical merchants, feeding the ranking) rather than just "search term", and `days` is given real semantics as a window anchored to `coverage.observed_through`. `limit` is left entirely undocumented in both schema and description, which keeps it short of a 5.

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?

"Search the merchant directory" names a specific verb and resource, and the body immediately explains what is ranked (canonical merchants whose descriptors match `q`) and on what basis (recent volume of matching descriptors). It also explicitly separates itself from the spend tools, which take a brand by name, so an agent can pick the right tool without opening the schema.

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?

It states when NOT to use it ("Not a first step: the spend tools take a brand by name") and the exact triggering conditions ("ambiguous, not found, or matched_by descriptor"). It then prescribes the follow-up sequence: search once, take the row whose merchant_name is the brand, pass its merchant_id.

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.