Skip to main content
Glama

batch_similarity_search

Runs exact cosine similarity search between query embeddings (M x D) and corpus embeddings (N x D) on distributed GPUs using OUTPUT_GRID_2D zero-reduction tiling.

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": {
      "queries": "<queries>",
      "corpus_embeddings": "<corpus_embeddings>"
    },
    "name": "batch_similarity_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
dtypeNoTarget GEMM precision.fp32
top_kNoNumber of top matching corpus indices and scores to return per query.
queriesYesFile path (.npy/.npz/.safetensors) or inline 2D array of shape (M, D).
output_pathNoOptional file path (.npy/.safetensors) to save the full similarity matrix.
corpus_embeddingsYesFile path (.npy/.npz/.safetensors) or inline 2D array of shape (N, D).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.8/5.0
Behavior2/5

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

With no annotations at all, the description carries the full burden, and it leaves major behavioral questions open: whether this submits an asynchronous distributed job, what resources or cost it consumes, whether corpus data is loaded fully into GPU memory, and what failure modes exist. 'Exact' versus approximate search is a useful disclosure, but 'OUTPUT_GRID_2D zero-reduction tiling' is implementation jargon that gives the agent no actionable signal.

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?

It is a single front-loaded sentence, which is structurally sound. However, the trailing tiling terminology is decoration that does not earn its place for a tool-selection decision.

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?

This is a five-parameter distributed compute tool with no annotations and no output schema. The description never explains what the agent gets back (ranked indices/scores versus a written matrix file) or whether execution is synchronous, which is essential context the structured fields do not cover.

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 each of the five parameters (dtype, top_k, queries, corpus_embeddings, output_path) is already documented in structured form. The description only restates the shapes and adds no extra meaning such as dtype trade-offs or what output_path implies about return behavior. 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?

The description states a specific verb and resource: 'Runs exact cosine similarity search between query embeddings (M x D) and corpus embeddings (N x D)'. That is far more precise than a tautology and clearly separates it from compute_pca_svd or get_network_status. It stops short of naming a sibling alternative, so it lands at 4 rather than 5.

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 guidance on when to use this instead of execute_distributed_matmul or estimate_job_cost, nor any prerequisites such as GPU availability or job submission flow. The agent must infer all routing decisions from the tool name alone.

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.