Skip to main content
Glama

bear_list_notes

Read-onlyIdempotent

List Bear notes, optionally filtered by tag, returning ID, title, tags (hierarchical and leaf), pin status, and modification date.

Instructions

List Bear notes with optional tag filtering. Returns an array of notes with IDs, titles, tags, pin status, and modification dates. Each note includes two tag fields: 'tags' mirrors Bear's CloudKit index verbatim (includes ancestor expansions — a note tagged #parent/child will show both 'parent' and 'parent/child'); 'attached_tags' shows only leaf tags (the most-specific tag on each branch). Notes with 'locked: true' are private/encrypted in Bear and their body content is not searchable — if a search returns no results, check whether the relevant note is locked. Use bear_get_note to read the full content of a specific note.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagNoFilter notes by tag (partial match)
include_archivedNoInclude archived notes in results
include_trashedNoInclude trashed notes in results
limitNoMaximum number of notes to return (default 30)

Implementation Reference

  • The 'bear_list_notes' tool handler entry in the tools registry. Contains the Tool definition (name, description, inputSchema, annotations), and the buildArgs function that converts user input into CLI arguments for the bcli 'ls --json' command. The key execution path: index.ts calls handler.buildArgs(params) then execBcliWithReauth(args).
    export const tools: Record<string, ToolHandler> = {
      bear_list_notes: {
        tool: {
          name: "bear_list_notes",
          description:
            "List Bear notes with optional tag filtering. Returns an array of notes with IDs, titles, tags, pin status, and modification dates. Each note includes two tag fields: 'tags' mirrors Bear's CloudKit index verbatim (includes ancestor expansions — a note tagged #parent/child will show both 'parent' and 'parent/child'); 'attached_tags' shows only leaf tags (the most-specific tag on each branch). Notes with 'locked: true' are private/encrypted in Bear and their body content is not searchable — if a search returns no results, check whether the relevant note is locked. Use bear_get_note to read the full content of a specific note.",
          inputSchema: {
            type: "object" as const,
            properties: {
              tag: {
                type: "string",
                description: "Filter notes by tag (partial match)",
              },
              include_archived: {
                type: "boolean",
                description: "Include archived notes in results",
              },
              include_trashed: {
                type: "boolean",
                description: "Include trashed notes in results",
              },
              limit: {
                type: "number",
                description:
                  "Maximum number of notes to return (default 30)",
              },
            },
          },
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
          },
        },
        buildArgs: (input) => {
          const args = ["ls", "--json"];
          if (input.tag) args.push("--tag", String(input.tag));
          if (input.include_archived) args.push("--archived");
          if (input.include_trashed) args.push("--trashed");
          if (input.limit) args.push("--limit", String(input.limit));
          return args;
        },
      },
  • Tool registration via the ListToolsRequestSchema handler. The tools from tools.ts are listed by mapping over Object.values(tools) and exposing their .tool property to the MCP client. This makes bear_list_notes discoverable.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: Object.values(tools).map((t) => t.tool),
    }));
  • Tool execution dispatcher (CallToolRequestSchema handler). When 'bear_list_notes' is called, it's looked up by name, buildArgs constructs the CLI args, then execBcliWithReauth executes the bcli binary. The JSON output is parsed and returned.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: input } = request.params;
      const handler = tools[name];
    
      if (!handler) {
        return {
          content: [{ type: "text", text: `Unknown tool: ${name}` }],
          isError: true,
        };
      }
    
      const params = (input ?? {}) as Record<string, unknown>;
    
      // Validate bear_edit_note: need at least one edit operation
      if (name === "bear_edit_note") {
        const hasAppend = params.append_text !== undefined;
        const hasBody = params.body !== undefined;
        const hasSetFm = params.set_frontmatter !== undefined &&
          Object.keys(params.set_frontmatter as object).length > 0;
        const hasRemoveFm = Array.isArray(params.remove_frontmatter) &&
          (params.remove_frontmatter as unknown[]).length > 0;
        const hasFm = hasSetFm || hasRemoveFm;
    
        if (!hasAppend && !hasBody && !hasFm) {
          return {
            content: [
              {
                type: "text",
                text: "Provide 'append_text', 'body', 'set_frontmatter', or 'remove_frontmatter'.",
              },
            ],
            isError: true,
          };
        }
        if (hasAppend && hasBody) {
          return {
            content: [
              {
                type: "text",
                text: "Provide either 'append_text' or 'body', not both.",
              },
            ],
            isError: true,
          };
        }
      }
    
      try {
        const args = handler.buildArgs(params);
        let result: { stdout: string; stderr: string };
    
        // Check if this tool needs stdin piping
        const stdinData = handler.usesStdin?.(params) ?? null;
        if (stdinData !== null) {
          result = await execBcliWithStdinAndReauth(args, stdinData);
        } else {
          result = await execBcliWithReauth(args);
        }
    
        // Parse JSON output from bcli
        const stdout = result.stdout.trim();
        if (!stdout) {
          return {
            content: [{ type: "text", text: "Command completed successfully." }],
          };
        }
    
        // Validate it's JSON and pretty-print
        try {
          const parsed = JSON.parse(stdout);
          return {
            content: [
              { type: "text", text: JSON.stringify(parsed, null, 2) },
            ],
          };
        } catch {
          // If bcli returned non-JSON, pass it through
          return {
            content: [{ type: "text", text: stdout }],
          };
        }
      } catch (error) {
        const message =
          error instanceof BcliError ? error.message : String(error);
        return {
          content: [{ type: "text", text: message }],
          isError: true,
        };
      }
    });
  • Input schema for bear_list_notes: accepts optional 'tag' (string), 'include_archived' (boolean), 'include_trashed' (boolean), and 'limit' (number) parameters.
    inputSchema: {
      type: "object" as const,
      properties: {
        tag: {
          type: "string",
          description: "Filter notes by tag (partial match)",
        },
        include_archived: {
          type: "boolean",
          description: "Include archived notes in results",
        },
        include_trashed: {
          type: "boolean",
          description: "Include trashed notes in results",
        },
        limit: {
          type: "number",
          description:
            "Maximum number of notes to return (default 30)",
        },
      },
    },
Behavior5/5

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

Beyond annotations (readOnlyHint, destructiveHint, idempotentHint), the description adds valuable behavioral context: locked notes are not searchable, body content is not searchable if locked, and explains the difference between 'tags' and 'attached_tags' fields. 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 (about 5 sentences) and front-loaded with the main purpose. It could be slightly more streamlined, but it efficiently covers key points without unnecessary verbosity.

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 tool's complexity (4 parameters, no output schema), the description is quite complete. It explains nuanced tag behavior, locked note implications, and directs users to bear_get_note for full content. This level of detail adequately supports an AI agent in selecting and using the tool.

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?

Schema coverage is 100% (all parameters described in schema). The description clarifies that tag filtering is a partial match, which adds some meaning. However, it does not significantly enhance understanding beyond the schema descriptions.

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 the tool's purpose: listing Bear notes with optional tag filtering. It specifies the return fields (IDs, titles, tags, pin status, modification dates) and distinguishes itself from sibling tools like bear_get_note and bear_search.

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 provides clear guidance on tag filtering (partial match, two tag fields), handling of locked notes, and suggests using bear_get_note for full content. It does not explicitly state when not to use this tool, but the context is sufficiently covered.

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