Skip to main content
Glama
netologist

Bear Notes MCP Server

by netologist

search_bear_notes

Search notes in Bear App by query, tag, or limit results to find specific information quickly.

Instructions

Search Bear App notes

Args: query: Text to search for (searches in title and content) tag: Tag to filter by (without # symbol) limit: Maximum number of results

Returns: List of matching notes with metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNo
tagNo
limitNo

Implementation Reference

  • main.py:154-170 (handler)
    The main handler function for the 'search_bear_notes' MCP tool. Registered via @mcp.tool() decorator. Provides the tool schema via type hints and docstring, and delegates to the search_notes helper with error handling.
    @mcp.tool()
    def search_bear_notes(query: str = "", tag: str = "", limit: int = 20) -> List[Dict[str, Any]]:
        """
        Search Bear App notes
        
        Args:
            query: Text to search for (searches in title and content)
            tag: Tag to filter by (without # symbol)
            limit: Maximum number of results
        
        Returns:
            List of matching notes with metadata
        """
        try:
            return search_notes(query, tag, limit)
        except Exception as e:
            return [{"error": f"Search error: {str(e)}"}]
  • main.py:28-79 (helper)
    Core helper function implementing the database query logic for searching Bear notes by query text and tags. Constructs dynamic SQL with parameters for safe querying.
    def search_notes(query: str = "", tag: str = "", limit: int = 20) -> List[Dict[str, Any]]:
        """Search Bear notes"""
        conn = get_bear_db_connection()
        
        try:
            # Base query
            sql = """
            SELECT 
                ZUNIQUEIDENTIFIER as id,
                ZTITLE as title,
                ZTEXT as content,
                ZCREATIONDATE as created_date,
                ZMODIFICATIONDATE as modified_date,
                ZTRASHED as is_trashed
            FROM ZSFNOTE 
            WHERE ZTRASHED = 0
            """
            
            params = []
            
            # Add search criteria
            if query:
                sql += " AND (ZTITLE LIKE ? OR ZTEXT LIKE ?)"
                params.extend([f"%{query}%", f"%{query}%"])
            
            # Add tag filter
            if tag:
                sql += " AND ZTEXT LIKE ?"
                params.append(f"%#{tag}%")
            
            sql += " ORDER BY ZMODIFICATIONDATE DESC LIMIT ?"
            params.append(limit)
            
            cursor = conn.execute(sql, params)
            results = []
            
            for row in cursor.fetchall():
                content = row["content"] or ""
                results.append({
                    "id": row["id"],
                    "title": row["title"] or "Untitled",
                    "content": content,
                    "created_date": row["created_date"],
                    "modified_date": row["modified_date"],
                    "preview": content[:200] + "..." if len(content) > 200 else content,
                    "word_count": len(content.split()) if content else 0
                })
            
            return results
            
        finally:
            conn.close()
  • main.py:19-26 (helper)
    Helper function to establish a connection to Bear App's SQLite database with row factory for dict-like access.
    def get_bear_db_connection():
        """Connect to Bear database"""
        if not os.path.exists(BEAR_DB_PATH):
            raise FileNotFoundError(f"Bear database not found: {BEAR_DB_PATH}")
        
        conn = sqlite3.connect(BEAR_DB_PATH)
        conn.row_factory = sqlite3.Row  # Enable column name access
        return conn
  • main.py:154-154 (registration)
    The @mcp.tool() decorator registers the search_bear_notes function as an MCP tool.
    @mcp.tool()
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions searching 'in title and content' and returning 'List of matching notes with metadata', but doesn't disclose critical traits like whether this is a read-only operation, how results are sorted, if there's pagination, or what 'metadata' includes. For a search tool with 3 parameters, this leaves significant gaps.

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 well-structured with a clear header and bullet-point-like sections for Args and Returns. It's front-loaded with the core purpose. However, the 'Args' and 'Returns' labels add minor redundancy, and it could be more concise by integrating parameter details into a single sentence.

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

Completeness3/5

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

Given 3 parameters with 0% schema coverage and no output schema, the description does an adequate job explaining inputs and the return type. However, it lacks details on output structure (what metadata?), error conditions, or performance limits. For a search tool with siblings, more context on differentiation would improve completeness.

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 description coverage is 0%, so the description must compensate—and it does by explaining all 3 parameters: 'query' searches title/content, 'tag' filters without # symbol, and 'limit' sets max results. This adds meaningful context beyond the bare schema, though it doesn't detail query syntax (e.g., wildcards) or tag behavior (e.g., multiple tags).

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?

The description clearly states the verb ('Search') and resource ('Bear App notes'), making the purpose immediately understandable. It distinguishes this tool from siblings like 'find_notes_by_title' or 'get_recent_notes' by specifying it searches both title and content. However, it doesn't explicitly contrast with 'find_code_examples' or 'find_kubernetes_examples', which might be more specialized search tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention siblings like 'find_notes_by_title' (which might search only titles) or 'list_bear_tags' (which might help with tag discovery). There's no context about prerequisites, such as whether Bear App needs to be running or authenticated.

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/netologist/mcp-bear-notes'

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