Use this file to discover all available pages before exploring further.
GetServerInfo returns a three-section snapshot of the connected SQL Server or Azure SQL Database instance: server property values (version, edition, server and machine names, collation, and more), hardware and process runtime metrics, and user-database counts. It is compatible with SQL Server 2008 R2 through SQL Server 2022 and Azure SQL Database.GetServerInfo takes no parameters and is a useful first call to verify that the MCP server connection is active and to identify the SQL Server version and edition before issuing other tool calls.
Runtime hardware and process memory metrics. Individual fields are null when the account lacks VIEW SERVER STATE or when a DMV column does not exist on the target SQL Server version. The call always succeeds even when all hardware fields are null.
Explains why one or more hardware fields are null. Present only when a DMV query failed (e.g. VIEW SERVER STATE permission denied, or a column does not exist on the running version). null when all hardware data was retrieved successfully.
GetServerInfo issues hardware queries against sys.dm_os_sys_info and sys.dm_os_process_memory inside separate try/catch blocks. If either query fails — because the account lacks VIEW SERVER STATE, or because a column was removed or renamed in the target SQL Server version — the server logs a warning, populates the hardware.warning field with the error message, and continues. The response is always returned successfully as long as the server-properties query succeeds.
VIEW SERVER STATE is typically required to read DMVs. On Azure SQL Database and Azure SQL Managed Instance, VIEW DATABASE STATE is often sufficient for subset DMV access, but hardware-level DMVs may still be restricted. Check hardware.warning to confirm.
Call GetServerInfo as the first tool when starting a new investigation session. It verifies connectivity and gives you the SQL Server version and edition, which determines which features and syntax are available (e.g. TRY_CAST is not available before SQL Server 2012, and some DMV columns vary between versions).
databases.totalDatabases counts user databases only. To enumerate the databases by name use ReadData with SELECT name, state_desc FROM sys.databases WHERE database_id > 4.