Skip to main content
Glama

list_databases

Retrieve a complete list of all databases available on the connected SQL Server instance for database exploration and management.

Instructions

List all databases on the SQL Server instance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that executes a SQL query against sys.databases to list user databases, excluding system databases, and formats the results.
    async listDatabases() { const query = ` SELECT name as database_name, database_id, create_date, collation_name, state_desc as state FROM sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb') ORDER BY name `; const result = await this.executeQuery(query, 'list_databases'); return this.formatResults(result); }
  • Tool registration definition including name, description, and empty input schema (no parameters required). Used by MCP server to list available tools.
    { name: 'list_databases', description: 'List all databases on the SQL Server instance', inputSchema: { type: 'object', properties: {} } },
  • Input schema definition: empty object since list_databases takes no parameters.
    inputSchema: { type: 'object', properties: {} }
  • MCP tool dispatch handler that delegates list_databases calls to the DatabaseToolsHandler instance.
    case 'list_databases': return { content: await this.databaseTools.listDatabases() };

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/egarcia74/warp-sql-server-mcp'

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