Skip to main content
Glama

Search notes

bm_search
Read-onlyIdempotent

Search a Basic Memory project by relevance across notes, observations, and relations using text, semantic, title, or permalink queries, with filters for narrowing results.

Instructions

Search a Basic Memory project, ranked by relevance. query supports quoted phrases, AND/OR/NOT and tag:name. mode picks hybrid (the default when semantic search is available), text, semantic, title or permalink (globs with *). Narrow with filters (frontmatter), note_types, items (notes, observations, relations) and since. lines returns the matching lines of each hit with that many lines of context, like grep. path limits the search to a folder; identifier searches one note. Read full notes with bm_read.

Input Schema

NameRequiredDescriptionDefault
modeNoSearch mode.
pageNoPage number.
pathNoSearch only this folder and its subfolders.
itemsNoWhat to return: notes, observations, relations, or a mix. Default: notes.
linesNoReturn each hit's matching lines with this many lines of context (0-10), instead of a match excerpt.
queryNoWhat to search for. Omit to search by filters alone.
sinceNoHow far back to look: '7d', '24h', '2 days ago', 'last week', or a date. Windows shorter than one day are widened to one day.
compactNoOmit note bodies and excerpts; keep identifiers and scores.
filtersNoFrontmatter filters as {field: condition}. Nested fields use dot notation ("schema.confidence"). A condition is a value for equality ({"status": "draft"}), null for absent-or-null ({"owner": null}), a list for contains-all ({"tags": ["a", "b"]}), or an operator object with $gt, $gte, $lt, $lte, $in, $between, $contains or $exists, e.g. {"priority": {"$in": ["high"]}}. Several operators on one field AND together.
projectNoProject name, 'workspace/project', or project external id. Omit to use the default project.
projectsNoSearch these projects together.
valid_atNoSpecialist: only facts whose authored valid time contains this date.
page_sizeNoResults per page (1-100).
time_kindNoSpecialist: effective, valid, occurred, due or mentioned.
categoriesNoObservation categories to match exactly, e.g. ['decision'].
identifierNoSearch only this note; returns its matching lines.
note_typesNoFrontmatter `type` values, e.g. ['person', 'meeting'].
max_matchesNoMatching lines shown per note with `lines`.
all_projectsNoSearch every project you can access.
output_formatNotext
min_similarityNoOverride the semantic similarity floor (0-1).
valid_overlapsNoSpecialist: only facts whose valid range overlaps '[start,end)'.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.24.1

TDQS

A4/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive, closed-world), so the description only needs to add operational context, which it does: results are ranked by relevance, the default mode is hybrid when semantic search is available, and `lines` produces grep-like line output instead of excerpts. Pagination behavior (page/page_size) is left entirely to the schema.

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 core search statement and ranking, then grouped by concern (query syntax, mode, narrowing, line output, scoping, alternative tool). Dense backtick-heavy phrasing for 22 parameters, but no sentence is redundant or padded.

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?

Given an output schema exists, return values need no explanation, and the description covers the main decision points: mode selection, narrowing dimensions, and the handoff to bm_read. Only pagination and the specialist temporal/similarity parameters are unmentioned, and those are self-documented in the schema.

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 95%, so the baseline is 3; the description exceeds it by explaining query syntax (quoted phrases, AND/OR/NOT, tag:name), the meaning of each mode including permalink globs, and the intent of filters/path/identifier/lines. Specialist parameters (valid_at, time_kind, valid_overlaps, min_similarity, compact, pagination) get no prose treatment, but they are documented in the schema.

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+resource ('Search a Basic Memory project, ranked by relevance') and immediately lists the dimensions that characterize the operation (modes, filters, line output). It routes to bm_read for full notes, so the agent can separate search from retrieval, though other similar siblings (search_notes, bm_find, grep) are never distinguished.

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?

Gives clear when-to-use signals for each mode ('hybrid (the default when semantic search is available)', permalink 'globs with *'), says query can be omitted to search by filters alone, and points to bm_read for reading full notes. It stops short of any when-NOT-to-use guidance or comparison against the overlapping search_notes/bm_find siblings.

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