Skip to main content
Glama

Notion MCP Server V2

by ankitmalik84
check_sqldb.pyโ€ข1.24 kB
import sqlite3 import pandas as pd from pyprojroot import here from IPython.display import display # Database file DB_PATH = here("data/chatbot.db") def get_table_names(): """Retrieve all table names from the SQLite database.""" conn = sqlite3.connect(DB_PATH) query = "SELECT name FROM sqlite_master WHERE type='table';" tables = pd.read_sql_query(query, conn)['name'].tolist() conn.close() return tables def fetch_table_data(table_name): """Fetch and return data from a specified table in the SQLite database.""" conn = sqlite3.connect(DB_PATH) df = pd.read_sql_query(f"SELECT * FROM {table_name};", conn) conn.close() return df def load_database(): """Load all tables, their shapes, and store their data in a dictionary of DataFrames.""" table_names = get_table_names() table_data = {} for table in table_names: df = fetch_table_data(table) # Show table name and shape print(f"๐Ÿ“Œ Table: {table} | Shape: {df.shape}") table_data[table] = df # Store DataFrame in a dictionary return table_data tables_dict = load_database() display(tables_dict["user_info"]) display(tables_dict["chat_history"]) display(tables_dict["summary"])

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/ankitmalik84/Agentic_Longterm_Memory'

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