Skip to main content
Glama
w2vgrep

w2vgrep

Official
by astartsky

semantic_search

Find conceptually similar words and related terms across text files using Word2Vec embeddings, enabling synonym and theme discovery beyond exact grep matches.

Instructions

Semantic search in text files using Word2Vec embeddings. Unlike grep, finds semantically similar words (e.g., searching "fear" also finds "anxiety", "terror", "dread").

Searches recursively in /search directory (mounted volume) for *.md files.

Use cases:

  • Find all mentions of a concept across files

  • Search for synonyms and related terms

  • Explore themes in documents

Response format: { "query": "search term", "total": 5, "matches": [{ "similarity": 0.85, "match": "matched text", "locations": [{ "file": "path/to/file.md", "line": 42, "context": "surrounding text" }] }] }

Matches sorted by similarity (1.0 = exact match).

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>",
      "model_path": "<model_path>"
    },
    "name": "semantic_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
globNoFile pattern (default: *.md)
queryYesSearch query (single word recommended, phrases may crash)
contextNoLines of context around match (default: 2). Set to 0 to reduce output size.
thresholdNoSimilarity threshold. 0.7=strict (default), 0.5-0.6=balanced. WARNING: values below 0.5 can return MASSIVE amounts of data (millions of characters), use with caution!
model_pathYesPath to Word2Vec model. Russian: ~/.config/semantic-grep/russian.bin, English: ~/.config/semantic-grep/english.bin
ignore_caseNoIgnore case

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does reasonably well: it discloses recursive traversal of the /search mounted volume, the *.md scope, that results are sorted by similarity with 1.0 meaning exact match, and the full response shape. It omits operational traits like whether a model file must exist, expected latency, or memory cost of broad queries (the latter is only in the schema), so it is not exhaustive.

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 the one-line definition and the grep contrast, then organized into scoping, use cases, and response format. The embedded JSON response example earns its space given there is no output schema, though the bulleted use-case list is somewhat redundant with the opening sentence.

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?

For a six-parameter tool with no output schema, the description supplies the return structure, similarity ordering, and search scope, which covers what the schema cannot. It stops short of explaining setup dependencies (the model file) or failure modes such as phrases crashing the query, which are mentioned only in the schema.

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 the six parameters (glob, query, context, threshold, model_path, ignore_case) are already fully documented with defaults and warnings. The description adds only an indirect echo — *.md files as the search scope and similarity semantics — but says nothing about glob, context, or ignore_case, so baseline 3 is appropriate.

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 and resource ('Semantic search in text files using Word2Vec embeddings') and immediately positions it against the obvious alternative by contrasting it with grep ('finds semantically similar words'). An agent can tell exactly what class of operation this is and why it differs from literal text matching.

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

Usage Guidelines4/5

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

Provides an explicit 'Use cases' list (concept mentions, synonyms, theme exploration) and the grep contrast, which gives clear context for selection. It lacks any 'when not to use' statement — e.g. exact-string or regex needs, or non-.md content — so it falls short of a full 5.

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

Deploy Server

Other Tools