Skip to main content
Glama

Search scripts by meaning

semantic_search

Search game code by what it does using local Ollama embeddings: index scripts, then query plain-language behavior to find matching chunks with paths and line numbers.

Instructions

Find code by what it does, not by exact words, with embeddings from a local Ollama (model embeddinggemma by default; nothing leaves the computer). Actions: index (read the scripts of the connected game and build the index; big games take several calls, repeat with offset set to the returned nextOffset until done is true), search (query, optional k, path_contains, place_id: returns the closest code chunks with their path and lines), status (what is indexed) and clear (delete the index of place_id, or all). Search and status do not need the game. Needs Ollama running with the model pulled (ollama pull embeddinggemma). For exact text use search_scripts instead.

Input Schema

NameRequiredDescriptionDefault
kNosearch: how many chunks to return (default 8).
rootNoindex: dotted path to index under (default game).
queryNosearch: what the code should do, in plain words.
actionYesWhat to do.
clientNoClient id from list_clients, for example c2. Defaults to the client that connected last.
offsetNoindex: script to continue from (default 0, which starts a new index).
place_idNosearch, status, clear: the place to use (default: the most recently indexed one; clear without it deletes every index).
class_nameNoindex: only this kind of script.
max_scriptsNoindex: scripts to process in this call (default 400).
path_containsNosearch: only chunks whose script path contains this.
budget_secondsNoindex: stop after this many seconds (default 100).
include_hiddenNoindex: also scripts outside the tree (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: input data stays local ('nothing leaves the computer'), big games require repeated calls until done is true, clear removes one place's index or all of them, and the default model is embeddinggemma. The only mild tension is that 'clear (delete the index)' is a removal operation while destructiveHint=false — acceptable because the index is derived, rebuildable data, but worth noting.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core distinction ('by what it does, not by exact words') is front-loaded, followed by the action list and then the routing note. Despite being a dense single paragraph with nested parentheses, every clause carries operational information; nothing is filler.

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 12-parameter, no-output-schema tool it covers prerequisites, pagination, per-action scope, and the search return shape ('closest code chunks with their path and lines'). Minor gaps remain: what status actually returns and confirmation of what clear reports are not described.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns more by mapping parameters to actions (index: offset/class_name/max_scripts/budget_seconds/include_hidden; search: query/k/path_contains/place_id), which the flat schema does not express. It also explains the offset/nextOffset continuation contract, though it does not spell out semantics for client or status output.

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 ('find code by what it does') plus the enabling mechanism (local Ollama embeddings), then enumerates all four actions with what each does. It also names the sibling it is not ('For exact text use search_scripts instead'), so an agent can route correctly without opening either schema.

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?

Gives explicit alternatives ('For exact text use search_scripts instead'), explicit prerequisites ('Needs Ollama running with the model pulled (ollama pull embeddinggemma)'), and the operational caveat that search and status do not need the game. It also explains the multi-call indexing loop with offset/nextOffset until done, which is exactly the guidance an agent needs to avoid a partial index.

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