Skip to main content
Glama

bear_search

Read-onlyIdempotent

Full-text search across Bear note titles, tags, and body content. Returns matching notes ranked by relevance with text snippets and locked note indicators.

Instructions

Full-text search across Bear note titles, tags, and body content. Returns matching notes ranked by relevance (title matches first, then tag, then body). Body matches include a text snippet with surrounding context. Locked/private notes will match by title but may not match body searches — results include 'locked: true' for these notes. If you can't find content you expect, try listing notes to check if the relevant note is locked.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query text
limitNoMaximum number of results (default 20)
sinceNoOnly notes modified after this date (YYYY-MM-DD, or: today, yesterday, last-week, last-month)
beforeNoOnly notes modified before this date (YYYY-MM-DD)

Implementation Reference

  • Input schema for bear_search tool: requires 'query' (string), optional 'limit' (number), 'since' (string date), 'before' (string date)
    inputSchema: {
      type: "object" as const,
      properties: {
        query: {
          type: "string",
          description: "Search query text",
        },
        limit: {
          type: "number",
          description: "Maximum number of results (default 20)",
        },
        since: {
          type: "string",
          description:
            "Only notes modified after this date (YYYY-MM-DD, or: today, yesterday, last-week, last-month)",
        },
        before: {
          type: "string",
          description:
            "Only notes modified before this date (YYYY-MM-DD)",
        },
      },
      required: ["query"],
    },
  • Handler (buildArgs) for bear_search: constructs CLI args array ['search', query, '--json'] with optional limit/since/before flags
      buildArgs: (input) => {
        const args = ["search", String(input.query), "--json"];
        if (input.limit) args.push("--limit", String(input.limit));
        if (input.since) args.push("--since", String(input.since));
        if (input.before) args.push("--before", String(input.before));
        return args;
      },
    },
  • Registration of bear_search in the tools registry (Record<string, ToolHandler>)
    bear_search: {
      tool: {
        name: "bear_search",
        description:
          "Full-text search across Bear note titles, tags, and body content. Returns matching notes ranked by relevance (title matches first, then tag, then body). Body matches include a text snippet with surrounding context. Locked/private notes will match by title but may not match body searches — results include 'locked: true' for these notes. If you can't find content you expect, try listing notes to check if the relevant note is locked.",
        inputSchema: {
          type: "object" as const,
          properties: {
            query: {
              type: "string",
              description: "Search query text",
            },
            limit: {
              type: "number",
              description: "Maximum number of results (default 20)",
            },
            since: {
              type: "string",
              description:
                "Only notes modified after this date (YYYY-MM-DD, or: today, yesterday, last-week, last-month)",
            },
            before: {
              type: "string",
              description:
                "Only notes modified before this date (YYYY-MM-DD)",
            },
          },
          required: ["query"],
        },
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
        },
      },
      buildArgs: (input) => {
        const args = ["search", String(input.query), "--json"];
        if (input.limit) args.push("--limit", String(input.limit));
        if (input.since) args.push("--since", String(input.since));
        if (input.before) args.push("--before", String(input.before));
        return args;
      },
    },
Behavior4/5

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

Annotations already mark the tool as read-only and idempotent. The description adds behavioral details: ranking order (title first, then tag, then body), locked note behavior (match by title, not body; 'locked: true' field), and inclusion of text snippets. No contradiction with annotations.

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?

The description is concise, front-loading the main purpose in the first sentence. It covers key behaviors without unnecessary detail, though it could be slightly tighter by combining redundant clauses.

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?

Without an output schema, the description sufficiently explains return values (ranking, snippet, locked flag). It also addresses edge cases (locked notes). However, it omits details about pagination or handling large result sets, which are partially addressed by the 'limit' parameter.

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 has 100% description coverage with clear parameter descriptions. The tool description does not add extra meaning beyond what the schema already provides for parameters like 'query', 'limit', 'since', and 'before', so it meets the baseline of 3.

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 Bear note titles, tags, and body content' and specifies ranking by relevance. It distinguishes from sibling tools like bear_list_notes (listing without search) and bear_get_note (individual note retrieval).

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?

The description advises that if expected content is not found, the agent should check if the note is locked by listing notes. While it doesn't explicitly state when not to use, it provides a practical alternative, which is helpful for decision-making.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mreider/better-bear'

If you have feedback or need assistance with the MCP directory API, please join our Discord server