Skip to main content
Glama

search_expanded

Search FOLIO with plain-English questions or fact patterns by expanding them into legal synonyms and terms of art, then merging ranked results for natural-language research.

Instructions

Search FOLIO with a plain-English question or fact pattern.

An LLM rewrites the query into synonyms and legal terms of art (e.g. "my landlord won't fix the heat" -> "Implied Warranty of Habitability", "Constructive Eviction"), searches each, and merges the results by rank. Use this for natural-language or situational queries; use search_concepts when you already know the concept's name. The first call for a query takes a few seconds; repeats are cached. If the LLM is unavailable it returns plain label-search results with an empty expansions list.

Args: query: Natural-language description (e.g., "fired for reporting safety violations"). limit: Maximum results (default 10, max 50). include_definitions: Also match concept definitions (default false).

Returns: JSON object: query, expansions, expansion_source ("llm", "cache" or "none"), and results [{iri, label, definition, score, matched_via}].

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": {
      "query": "<query>"
    },
    "name": "search_expanded"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
queryYes
include_definitionsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.5

TDQS

A4.9/5.0
Behavior5/5

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

No annotations are supplied, so the description carries the full behavioral burden and does so well: it discloses the internal LLM expansion step, caching of repeat queries, seconds of latency on first call, and a documented fallback that returns plain label-search results with an empty expansions list. It also names expansion_source values ("llm", "cache", "none") so the agent can interpret degraded results.

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?

Front-loaded with purpose and routing guidance, then a tidy Args/Returns block that is scannable. The Returns section partially restates a return schema that already exists, which is mild redundancy, but the expansion_source enumeration still adds interpretive value.

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?

Covers purpose, sibling routing, latency/caching, failure mode, and parameter semantics for a three-parameter tool with no annotations. An agent can decide to call it, invoke it correctly, and interpret a degraded response without consulting anything else.

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%, yet the description documents all three parameters with meaning the schema lacks: query is a natural-language description with an example, limit gets an explicit max of 50 (the schema only shows the default), and include_definitions is explained as also matching concept definitions. This fully compensates for the empty schema descriptions.

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?

States a specific verb+resource ("Search FOLIO with a plain-English question") and immediately contrasts it with the sibling search_concepts. The parenthetical mapping example ("my landlord won't fix the heat" -> "Implied Warranty of Habitability") makes the resource and behavior unambiguous.

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?

Explicitly says when to use this tool (natural-language or situational queries) and when to use the alternative (search_concepts when you already know the concept's name). It also warns about first-call latency and the LLM-unavailable degradation path, so the agent knows what to expect operationally.

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