Skip to main content
Glama
MIT License
9
18
  • Linux
  • Apple
database.ts1.76 kB
/** * Common interface for all database connections */ export interface Database { /** * Connect to the database */ connect(): Promise<void>; /** * Disconnect from the database */ disconnect(): Promise<void>; /** * Execute a query and return results * @param query SQL query to execute * @param params Parameters for the query */ query(query: string, params?: any[]): Promise<any>; /** * Execute a query that doesn't return results (INSERT, UPDATE, DELETE) * @param query SQL query to execute * @param params Parameters for the query */ execute(query: string, params?: any[]): Promise<void>; /** * Get database schema information */ getSchema(): Promise<SchemaInfo>; /** * Get all table names */ getTables(): Promise<string[]>; /** * Get column information for a specific table * @param tableName Name of the table */ getTableSchema(tableName: string): Promise<TableSchema>; } /** * Database schema information */ export interface SchemaInfo { /** * Database name */ databaseName: string; /** * Tables in the database */ tables: TableSchema[]; } /** * Table schema information */ export interface TableSchema { /** * Table name */ tableName: string; /** * Columns in the table */ columns: ColumnInfo[]; } /** * Column information */ export interface ColumnInfo { /** * Column name */ name: string; /** * Column data type */ type: string; /** * Whether the column is nullable */ nullable: boolean; /** * Whether the column is a primary key */ isPrimaryKey: boolean; /** * Default value for the column (if any) */ defaultValue?: any; }

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/cuongtl1992/mcp-dbs'

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