Class GrouperMcpDocSearch

java.lang.Object
edu.internet2.middleware.grouper.ws.mcp.GrouperMcpDocSearch

public class GrouperMcpDocSearch extends Object
MCP tool handler for searching institutional documentation. Uses a Lucene in-memory index built from configured database content sources to provide full-text search with relevance ranking.

Supports four actions:

  • query (default): full-text search returning ranked chunks
  • retrieveChunk: retrieve specific chunks by sourceConfigId, name, and chunkIndexes
  • listSourceConfigIds: list available source config ids with descriptions
  • listNames: list document names for a given sourceConfigId
  • Constructor Details

    • GrouperMcpDocSearch

      public GrouperMcpDocSearch()
  • Method Details

    • toolDefinition

      public static com.fasterxml.jackson.databind.node.ObjectNode toolDefinition()
      Return the MCP tool definition for doc_search. The description dynamically includes documentation about configured sources so the AI client knows what content is searchable.
      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 doc_search tool, dispatching by action
      Parameters:
      arguments - the tool arguments from the MCP request
      authUser - the authenticated user
      Returns:
      the MCP tool result