Skip to main content
Glama

bear_context_search

Read-onlyIdempotent

Search across Bear notes, external files, and inbox to locate matching text snippets with filenames and origin labels when the index alone is insufficient.

Instructions

Full-text search across the entire context library (Bear notes + external files + inbox). Returns matching snippets with filenames and origin labels. Use when the index alone isn't enough to find the right file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (case-insensitive substring match)
limitNoMaximum results (default: 5)

Implementation Reference

  • Tool definition for bear_context_search, including inputSchema (schema) and buildArgs (handler logic that builds CLI args for the bcli tool).
    bear_context_search: {
      tool: {
        name: "bear_context_search",
        description:
          "Full-text search across the entire context library (Bear notes + external files + inbox). Returns matching snippets with filenames and origin labels. Use when the index alone isn't enough to find the right file.",
        inputSchema: {
          type: "object" as const,
          properties: {
            query: {
              type: "string",
              description: "Search query (case-insensitive substring match)",
            },
            limit: {
              type: "number",
              description: "Maximum results (default: 5)",
            },
          },
          required: ["query"],
        },
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
        },
      },
      buildArgs: (input) => {
        const args = ["context", "search", String(input.query), "--json"];
        if (input.limit) args.push("--limit", String(input.limit));
        return args;
      },
    },

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.19

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already indicate read-only, non-destructive, and idempotent behavior. The description adds that search covers multiple sources and returns snippets with filenames and origin labels, which is helpful context beyond annotations.

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?

Two sentences efficiently cover purpose, scope, output, and usage guidance. Every sentence adds value with no redundancy.

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 search tool with simple parameters and no output schema, the description is adequately complete. It covers sources, output, and use-case context, though it could optionally detail snippet format.

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?

The input schema is fully documented (100% coverage) with descriptions for both parameters ('query' and 'limit'). The description does not add additional meaning beyond what the schema provides.

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 clearly states 'Full-text search across the entire context library (Bear notes + external files + inbox)' and specifies the output, distinguishing it from related tools like bear_search and bear_context_index.

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 advises 'Use when the index alone isn't enough to find the right file,' giving a clear condition for use. Though it doesn't explicitly mention when not to use, it effectively guides selection among siblings.

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