Class GrouperMcpSqlSelect
java.lang.Object
edu.internet2.middleware.grouper.ws.mcp.GrouperMcpSqlSelect
MCP tool handler for executing read-only SQL SELECT queries against the
Grouper database or other configured external systems. Only SELECT
statements are allowed; DML and DDL are rejected. Results are returned
as a JSON array of row objects.
Uses paging (pageSize/pageNumber) and a read-only JDBC connection
for defense-in-depth. The default database connection can be configured
via grouper.mcp.sqlGrouperExternalSystem. Additional external systems
are available when configured with grouper.mcp.<id>.sqlTablesViews
or grouper.mcp.<id>.sqlTablesViewsQuery.
Supports countOnly mode to return just the row count without fetching data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.node.ObjectNodeexecute(com.fasterxml.jackson.databind.JsonNode arguments, GrouperMcpAuthUser authUser) execute the sql_select toolstatic com.fasterxml.jackson.databind.node.ObjectNodereturn the MCP tool definition for sql_select
-
Constructor Details
-
GrouperMcpSqlSelect
public GrouperMcpSqlSelect()
-
-
Method Details
-
toolDefinition
public static com.fasterxml.jackson.databind.node.ObjectNode toolDefinition()return the MCP tool definition for sql_select- Returns:
- the tool definition as a Jackson ObjectNode
-
execute
public static com.fasterxml.jackson.databind.node.ObjectNode execute(com.fasterxml.jackson.databind.JsonNode arguments, GrouperMcpAuthUser authUser) execute the sql_select tool- Parameters:
arguments- the tool arguments from the MCP requestauthUser- the authenticated user- Returns:
- the MCP tool result
-