We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/brockwebb/open-census-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
check_gazetteer.pyโข1.62 KiB
#!/usr/bin/env python3
"""Check gazetteer database schema"""
import sqlite3
from pathlib import Path
def check_gazetteer_schema():
# Find the gazetteer database
possible_paths = [
Path(__file__).parent / "knowledge-base" / "geography.db",
Path(__file__).parent / "geography.db"
]
db_path = None
for path in possible_paths:
if path.exists():
db_path = path
break
if not db_path:
print("โ No gazetteer database found")
return
print(f"โ Found gazetteer: {db_path}")
try:
conn = sqlite3.connect(str(db_path))
cursor = conn.cursor()
# Get all tables
cursor.execute("SELECT name FROM sqlite_master WHERE type='table'")
tables = [row[0] for row in cursor.fetchall()]
print(f"\n๐ Tables: {tables}")
# Check schema for each table
for table in tables:
print(f"\n๐ {table} schema:")
cursor.execute(f"PRAGMA table_info({table})")
columns = cursor.fetchall()
for col in columns:
print(f" {col[1]} ({col[2]})")
# Show sample data
cursor.execute(f"SELECT * FROM {table} LIMIT 3")
sample = cursor.fetchall()
if sample:
print(f" Sample rows: {len(sample)}")
for row in sample[:1]: # Just first row
print(f" {row}")
conn.close()
except Exception as e:
print(f"โ Database error: {e}")
if __name__ == "__main__":
check_gazetteer_schema()