Package org.gridgain.internal.mcp.tools
Class SchemaDiscovery
java.lang.Object
org.gridgain.internal.mcp.tools.SchemaDiscovery
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic McpResponsegetSystemViewSchemaDefinition(@Nullable String viewName) Gets detailed schema definition for a specific system view.static McpResponsegetTableSchemaDefinition(@Nullable String tableName) Gets detailed schema definition for a specific table.static reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.CallToolResult>handleGetSystemViewSchema(io.modelcontextprotocol.server.McpAsyncServerExchange exchange, Map<String, Object> arguments) Handles execution of theget_system_view_schema_definitiontool.static reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.CallToolResult>handleGetTableSchema(io.modelcontextprotocol.server.McpAsyncServerExchange exchange, Map<String, Object> arguments) Handles execution of theget_table_schema_definitiontool.static reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.CallToolResult>handleListSystemViews(io.modelcontextprotocol.server.McpAsyncServerExchange exchange, Map<String, Object> arguments) Handles execution of thelist_all_system_viewstool.static reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.CallToolResult>handleListTables(io.modelcontextprotocol.server.McpAsyncServerExchange exchange, Map<String, Object> arguments) Handles execution of thelist_all_database_tablestool.static McpResponseLists all available tables in the database.static McpResponseLists all available system views in the database.
-
Constructor Details
-
SchemaDiscovery
public SchemaDiscovery()
-
-
Method Details
-
listAllDatabaseTables
Lists all available tables in the database.- Returns:
- MCP response with table listing or error
-
getTableSchemaDefinition
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
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
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 thelist_all_database_tablestool.- Parameters:
exchange- MCP server exchangearguments- 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 theget_table_schema_definitiontool.- Parameters:
exchange- MCP server exchangearguments- 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 thelist_all_system_viewstool.- Parameters:
exchange- MCP server exchangearguments- 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 theget_system_view_schema_definitiontool.- Parameters:
exchange- MCP server exchangearguments- tool arguments- Returns:
- reactive MCP tool result
-