Class SchemaDiscovery

java.lang.Object
org.gridgain.internal.mcp.tools.SchemaDiscovery

public class SchemaDiscovery extends Object
Schema Discovery tools for GridGain 9 MCP Server. Provides static methods for: - Listing all database tables - Listing all system views - Getting table schema definitions - Getting system view schema definitions Returns MCP-formatted responses.
  • Constructor Details

    • SchemaDiscovery

      public SchemaDiscovery()
  • Method Details

    • listAllDatabaseTables

      public static McpResponse listAllDatabaseTables()
      Lists all available tables in the database.
      Returns:
      MCP response with table listing or error
    • getTableSchemaDefinition

      public static McpResponse getTableSchemaDefinition(@Nullable @Nullable String tableName)
      Gets detailed schema definition for a specific table. - Input validation (null, empty, invalid format) - SQL injection prevention via parameterized queries - Column names and ordinal positions - Data types with precision/scale/length - Primary key columns - Colocation key columns - Nullable constraints
      Parameters:
      tableName - table name (e.g., 'TABLE' or 'PUBLIC.TABLE')
      Returns:
      MCP response with schema definition or error
    • listAllSystemViews

      public static McpResponse listAllSystemViews()
      Lists all available system views in the database. System views are built-in and provide monitoring and diagnostic information about cluster state (CLUSTER type views) and node-specific data (NODE type views).
      Returns:
      MCP response with system view listing or error
    • getSystemViewSchemaDefinition

      public static McpResponse getSystemViewSchemaDefinition(@Nullable @Nullable String viewName)
      Gets detailed schema definition for a specific system view. Returns metadata along with column names, data types, precision, scale, length, and nullable constraints for monitoring/diagnostic views.
      Parameters:
      viewName - system view name (e.g., 'TABLES' or 'SYSTEM.TABLES')
      Returns:
      MCP response with view schema definition
    • handleListTables

      public static reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.CallToolResult> handleListTables(io.modelcontextprotocol.server.McpAsyncServerExchange exchange, Map<String,Object> arguments)
      Handles execution of the list_all_database_tables tool.
      Parameters:
      exchange - MCP server exchange
      arguments - tool arguments
      Returns:
      reactive MCP tool result
    • handleGetTableSchema

      public static reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.CallToolResult> handleGetTableSchema(io.modelcontextprotocol.server.McpAsyncServerExchange exchange, Map<String,Object> arguments)
      Handles execution of the get_table_schema_definition tool.
      Parameters:
      exchange - MCP server exchange
      arguments - tool arguments
      Returns:
      reactive MCP tool result
    • handleListSystemViews

      public static reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.CallToolResult> handleListSystemViews(io.modelcontextprotocol.server.McpAsyncServerExchange exchange, Map<String,Object> arguments)
      Handles execution of the list_all_system_views tool.
      Parameters:
      exchange - MCP server exchange
      arguments - tool arguments
      Returns:
      reactive MCP tool result
    • handleGetSystemViewSchema

      public static reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.CallToolResult> handleGetSystemViewSchema(io.modelcontextprotocol.server.McpAsyncServerExchange exchange, Map<String,Object> arguments)
      Handles execution of the get_system_view_schema_definition tool.
      Parameters:
      exchange - MCP server exchange
      arguments - tool arguments
      Returns:
      reactive MCP tool result