Skip to main content
Glama

Lexical Search

vector_lexical_search
Read-onlyIdempotent

Search indexed collections using term-based lexical retrieval to find documents that match specific keywords or phrases.

Instructions

Performs indexed lexical or term-based retrieval.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "vector_lexical_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
db_typeNodb type
questionNoquestion
number_resultsNonumber results
collection_nameNocollection name

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv3.3.8
    • removedInput schema / properties / lexical_weight
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "lexical weight"
      -}
    • removedInput schema / properties / rrf_k
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "integer"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "rrf k"
      -}
    • removedInput schema / properties / semantic_weight
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "semantic weight"
      -}
  2. Addedv3.3.0

TDQS

C2.9/5.0
Behavior2/5

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

The annotations already cover the safety profile: read-only, idempotent, non-destructive, and closed-world. The description adds only the lexical/term-based retrieval concept and does not disclose ranking behavior, empty-result handling, index requirements, or any other operational context beyond what the annotations and schema imply.

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 description is a single front-loaded sentence with no wasted wording. Its brevity is efficient, though it leaves important selection context unstated.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The output schema and annotations are present, and parameters are fully documented, so the description need not explain return values or safety. However, for a search tool that sits alongside vector_semantic_search and vector_search, the description is incomplete because it does not explain when lexical search is the correct choice.

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 description coverage is 100%, so all four parameters are already documented in the input schema. The description does not add syntax, constraints, or meaning beyond that baseline, so the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and retrieval modality: 'indexed lexical or term-based retrieval.' This is clear enough to distinguish it broadly from semantic retrieval, but it never names or contrasts the sibling search tools such as vector_semantic_search or vector_search.

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

Usage Guidelines2/5

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

There is no explicit guidance on when to choose lexical search versus the sibling vector_semantic_search or vector_search tools. The agent is left to infer the appropriate use case from the tool name and the short phrase 'term-based retrieval.'

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