Skip to main content
Glama

Ctx Search

ctx_search
Read-onlyIdempotent

Search stored context chunks by meaning using semantic embeddings, with automatic fallback to keyword FTS5 search when semantic results are unavailable.

Instructions

Search stored chunks — semantic (embeddings) first, FTS5 fallback.

When semantic=True (default) and the embedding backend is available, searches by meaning using FAISS HNSW. Falls back to FTS5 keyword search if no backend, no index, or no semantic results.

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

Input Schema

NameRequiredDescriptionDefault
limitNomax results (default 5)
queryYessearch query (natural language or keywords)
semanticNouse semantic search first (default True)
session_idNosession to search ("default" = the shared default session only)default

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A3.9/5.0
Behavior4/5

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

Beyond the read-only and idempotent annotations, it discloses the embedding-backend dependency, FAISS HNSW retrieval, and three concrete FTS5 fallback triggers: no backend, no index, or no semantic results. The exact semantic=False path and result-ranking behavior remain implicit.

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 purpose and search strategy are front-loaded, followed by a compact explanation of defaults and fallback conditions. Both paragraphs contribute relevant information without unnecessary prose.

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?

Combined with the fully described input schema, output schema, and safety annotations, the description is sufficient for correct invocation and sets accurate expectations about fallback. Its main omissions are sibling-selection guidance and an explicit statement that semantic=False bypasses semantic retrieval.

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%, establishing a baseline of 3, but the description adds useful operational meaning for semantic by explaining backend availability and fallback behavior. It adds little beyond the schema for limit, query, or session_id.

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 opening line gives a specific verb and resource—searching stored chunks—and clarifies that retrieval can be semantic or keyword-based. It does not explicitly distinguish this query-based search from siblings such as ctx_get, so its differentiation is incomplete.

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?

The description explains the conditions under which semantic search and fallback operate, but this is primarily operational guidance. It does not say when to choose ctx_search over a sibling, nor when setting semantic=False for keyword search is preferable.

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