Skip to main content
Glama

Search notes

bm_search
Read-onlyIdempotent

Search Basic Memory projects by relevance across text, semantic, title, or permalink modes; narrow results with frontmatter filters, date scopes, note types, and line context to find exact notes.

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. Scope every search with project (one project), projects (a list), or all_projects=true. Read full notes with bm_read.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "bm_search"
  }
}

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 external id. Required for one-project operations; search may instead use `projects` or `all_projects=true`. Project discovery needs no scope.
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. Changed3 schema fields changed
    • changedInput schema / properties / project / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / project / description
      Previous value: -"Project name, 'workspace/project', or project external id. Omit to use the default project."New value: +"Project name, 'workspace/project', or external id. Required for one-project operations; search may instead use `projects` or `all_projects=true`. Project discovery needs no scope."
    • changedOutput schema / properties / result / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  }
      +]
  2. Addedv0.24.1

TDQS

A4.5/5.0
Behavior4/5

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

The annotations already establish that this is a read-only, idempotent, non-destructive operation. The description adds useful behavioral detail beyond that: relevance ranking, hybrid mode as the default when semantic search is available, grep-like line output, and the requirement to scope every search.

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 description is dense and front-loaded, leading with what the tool does and then covering query syntax, mode, narrowing, line output, scoping, and the bm_read follow-up. Every sentence carries useful information for a complex search tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the rich input schema, output schema, and safety annotations, the description provides enough context to select and invoke the tool correctly. It emphasizes the critical scoping requirement and the main search behaviors without redundantly restating structured fields.

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, but the description adds real meaning for key parameters: query syntax with quoted phrases and AND/OR/NOT/tag:name, hybrid mode default behavior, filters on frontmatter, grep-like lines, and project scoping. It does not cover every one of the 22 parameters, but it covers the parameters most likely to affect correct invocation.

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?

The description states a specific verb and resource: search a Basic Memory project, ranked by relevance. It also names bm_read as the follow-up tool for full notes, making the boundary between searching and reading explicit.

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?

It gives clear usage context: use query syntax, choose a mode, narrow with filters/note_types/items/since, scope with project/projects/all_projects, and use bm_read for full notes. It does not explicitly distinguish bm_search from the sibling bm_find or bm_list, so the closest alternative remains unaddressed.

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