Skip to main content
Glama

get_notes_like

Search Bear Notes for content containing specific text strings to quickly locate relevant information within your notes database.

Instructions

Get notes that include a specific text string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
likeYesFind notes that have this text

Implementation Reference

  • The `get_notes_like` function in `src/mcp_bear/database.py` executes a SQL query against the Bear Notes database to search for notes containing specific text in their title or body, and returns them as a list of dictionaries.
    def get_notes_like(search_text: str) -> list[dict[str, Any]]:
        """Search for notes containing specific text in title or body."""
        db_path = get_bear_db_path()
        conn = sqlite3.connect(db_path)
        conn.row_factory = sqlite3.Row
        cursor = conn.cursor()
    
        try:
            # Use parameterized query to prevent SQL injection
            query = """
                SELECT * FROM ZSFNOTE
                WHERE ZARCHIVED=0
                AND (ZTEXT LIKE ? OR ZTITLE LIKE ?);
            """
            search_pattern = f"%{search_text}%"
            cursor.execute(query, (search_pattern, search_pattern))
            rows = cursor.fetchall()
    
            notes = []
            for row in rows:
                notes.append({
                    "ZCREATIONDATE": row["ZCREATIONDATE"],
                    "ZSUBTITLE": row["ZSUBTITLE"],
                    "ZTEXT": row["ZTEXT"],
                    "ZTITLE": row["ZTITLE"],
                    "ZUNIQUEIDENTIFIER": row["ZUNIQUEIDENTIFIER"],
                })
    
            return notes
        finally:
            conn.close()

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/maxim-ist/mcp-bear'

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