Skip to main content
Glama

list_tables

Retrieve a list of all tables stored in the SQLite database used by the MCP Variance Log to track statistical variations in conversation structure.

Instructions

List all tables in the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the list_tables tool: executes SQL query on sqlite_master to list table names and returns results as text.
    if name == "list_tables": results = db._execute_query( "SELECT name FROM sqlite_master WHERE type='table'" ) return [types.TextContent(type="text", text=str(results))]
  • Registration of list_tables tool in handle_list_tools(), defining name, description, and empty input schema.
    types.Tool( name="list_tables", description="List all tables in the database", inputSchema={ "type": "object", "properties": {} } ),
  • Input schema for list_tables tool: empty object (no parameters required).
    inputSchema={ "type": "object", "properties": {} }
  • Helper method _execute_query on LogDatabase used by list_tables handler to execute the SQL query and fetch results.
    def _execute_query(self, query: str, params: dict[str, Any] | None = None) -> list[dict[str, Any]]: """Execute a SQL query and return results as a list of dictionaries""" logger.debug(f"Executing query: {query}") try: with closing(sqlite3.connect(self.db_path)) as conn: conn.row_factory = sqlite3.Row with closing(conn.cursor()) as cursor: if params: cursor.execute(query, params) else: cursor.execute(query) if query.strip().upper().startswith(('INSERT', 'UPDATE', 'DELETE', 'CREATE', 'DROP', 'ALTER')): conn.commit() affected = cursor.rowcount logger.debug(f"Write query affected {affected} rows") return [{"affected_rows": affected}] results = [dict(row) for row in cursor.fetchall()] logger.debug(f"Read query returned {len(results)} rows") return results except Exception as e: logger.error(f"Database error executing query: {e}") raise

Other Tools

Related Tools

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/truaxki/mcp-variance-log'

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