Skip to main content
Glama

get_notes

Retrieve all notes from Bear Notes on macOS to access, search, and manage your content through the MCP Bear server interface.

Instructions

Get all notes from Bear

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual handler function 'get_notes' which queries the SQLite database for non-archived notes.
    def get_notes() -> list[dict[str, Any]]:
        """Retrieve all non-archived notes from Bear."""
        db_path = get_bear_db_path()
        conn = sqlite3.connect(db_path)
        conn.row_factory = sqlite3.Row
        cursor = conn.cursor()
    
        try:
            cursor.execute("SELECT * FROM ZSFNOTE WHERE ZARCHIVED=0;")
            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()
  • Registration of the 'get_notes' tool in the MCP server via the list_tools decorator.
    Tool(
        name="get_notes",
        description="Get all notes from Bear",
        inputSchema={
            "type": "object",
            "properties": {},
        },
    ),
  • Call-site logic in the server's 'call_tool' handler that invokes 'get_notes' when requested.
    if name == "get_notes":
        notes = get_notes()
        return [TextContent(type="text", text=str({"notes": notes}))]

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