Skip to main content
Glama
netologist

Bear Notes MCP Server

by netologist

find_notes_by_title

Search for notes in Bear App by title, using exact or partial matching to quickly locate specific content.

Instructions

Find notes by title

Args: title_query: Title text to search for exact_match: Whether to match title exactly or use partial matching

Returns: Notes matching the title criteria

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
title_queryYes
exact_matchNo

Implementation Reference

  • main.py:308-367 (handler)
    The handler function that implements the core logic of the 'find_notes_by_title' tool. It connects to the Bear App database, executes SQL queries for exact or partial title matching, processes results into structured dictionaries with previews, and handles exceptions.
    def find_notes_by_title(title_query: str, exact_match: bool = False) -> List[Dict[str, Any]]:
        """
        Find notes by title
        
        Args:
            title_query: Title text to search for
            exact_match: Whether to match title exactly or use partial matching
        
        Returns:
            Notes matching the title criteria
        """
        try:
            conn = get_bear_db_connection()
            
            if exact_match:
                sql = """
                SELECT 
                    ZUNIQUEIDENTIFIER as id,
                    ZTITLE as title,
                    ZTEXT as content,
                    ZCREATIONDATE as created_date,
                    ZMODIFICATIONDATE as modified_date
                FROM ZSFNOTE 
                WHERE ZTRASHED = 0 AND ZTITLE = ?
                ORDER BY ZMODIFICATIONDATE DESC
                """
                params = [title_query]
            else:
                sql = """
                SELECT 
                    ZUNIQUEIDENTIFIER as id,
                    ZTITLE as title,
                    ZTEXT as content,
                    ZCREATIONDATE as created_date,
                    ZMODIFICATIONDATE as modified_date
                FROM ZSFNOTE 
                WHERE ZTRASHED = 0 AND ZTITLE LIKE ?
                ORDER BY ZMODIFICATIONDATE DESC
                """
                params = [f"%{title_query}%"]
            
            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
                })
            
            conn.close()
            return results
            
        except Exception as e:
            return [{"error": f"Error searching by title: {str(e)}"}]
  • main.py:307-307 (registration)
    The @mcp.tool() decorator registers the find_notes_by_title function as an MCP tool, making it available via the FastMCP server.
    @mcp.tool()
  • main.py:19-26 (helper)
    Helper function used by the tool to create a SQLite connection to the Bear App database with row_factory enabled for dictionary-like row 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
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool finds notes by title and describes parameters, but lacks critical behavioral details such as whether this is a read-only operation, how results are returned (e.g., pagination, format), error handling, or any rate limits. The description is minimal and doesn't adequately cover behavioral traits beyond basic functionality.

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 appropriately sized and structured with a clear purpose statement followed by Args and Returns sections. Every sentence adds value, with no redundant information. However, the 'Returns' section is somewhat vague ('Notes matching the title criteria'), which slightly reduces efficiency.

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

Completeness2/5

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

Given the complexity (2 parameters, no annotations, no output schema), the description is incomplete. It covers basic purpose and parameters but lacks details on behavioral traits, output format, error handling, and differentiation from sibling tools. For a search tool with no structured support, this leaves significant gaps for an AI agent to use it correctly.

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?

The description adds meaningful context for both parameters: 'title_query' is explained as 'Title text to search for' and 'exact_match' as 'Whether to match title exactly or use partial matching'. With 0% schema description coverage, this compensates well by clarifying the purpose and behavior of each parameter, though it doesn't specify syntax or examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Find notes by title' which clearly indicates the verb (find) and resource (notes), but it's vague about scope and doesn't differentiate from sibling tools like 'search_bear_notes' or 'get_recent_notes'. It specifies the search criteria (title) but lacks detail about what 'notes' refers to in this context.

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?

No guidance is provided on when to use this tool versus alternatives like 'search_bear_notes' or 'get_recent_notes'. The description only states what the tool does without indicating context, prerequisites, or exclusions, leaving the agent to infer usage from the tool name alone.

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