Skip to main content
Glama

IA-QA — 152 QA & Dev Tools for AI Agents

bm25_score

Read-onlyIdempotent

Compute BM25 relevance score between a query and one or more documents. BM25 is the industry-standard keyword-based ranking algorithm used in Elasticsearch, OpenSearch, and Weaviate hybrid search. Returns ranked results with normalized scores.

Input Schema

NameRequiredDescriptionDefault
bNoLength normalization factor (default: 0.75)
k1NoTerm frequency saturation (default: 1.5)
queryYesThe search query
top_kNoReturn top K results (default: all)
documentsYesArray of documents to rank

Output Schema

NameRequiredDescriptionDefault
bNo
k1No
indexNo
queryNo
resultsNo
bm25_scoreNo
doc_lengthNo
doc_previewNo
avg_doc_lengthNo
documents_countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "documents": [
      +      "shipping times",
      +      "refund for damaged items",
      +      "office hours"
      +    ],
      +    "query": "refund damaged"
      +  }
      +]
  2. Changed1 schema field changed
    • addedOutput schema / properties
      Added value: +{
      +  "avg_doc_length": {
      +    "type": "number"
      +  },
      +  "b": {},
      +  "bm25_score": {
      +    "type": "number"
      +  },
      +  "doc_length": {
      +    "type": "number"
      +  },
      +  "doc_preview": {},
      +  "documents_count": {
      +    "type": "number"
      +  },
      +  "index": {},
      +  "k1": {},
      +  "query": {},
      +  "results": {}
      +}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  4. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive behavior, so safety is covered. The description adds genuinely new behavioral context: it returns ranked results with normalized scores, which tells the agent what to expect from the call.

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?

Three tight sentences with the core action front-loaded. The middle sentence is mildly promotional ('industry-standard') but earns its place by orienting the algorithm against known search systems.

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?

With an output schema present, a fully documented parameter schema, and complete annotations, the description only needs to convey purpose and output character, which it does. Missing only explicit guidance on ordering versus its ranking/similarity siblings.

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 query, documents, b, k1, and top_k are all documented in the schema. The description adds no tuning guidance for b/k1 or explanation of top_k beyond what the schema provides, so baseline 3 applies.

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?

States a specific verb and resource: 'Compute BM25 relevance score between a query and one or more documents.' The keyword-based ranking framing implicitly distinguishes it from vector or embedding sibling tools, but no sibling is named explicitly.

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?

Mentions the algorithm's provenance (Elasticsearch, OpenSearch, Weaviate hybrid search), which hints at context, but never states when to choose this over alternatives such as embedding_similarity, similarity_score, or rag_relevance_rank. Usage 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.