Class McpConfigurationConfig.ConfigurationTools

java.lang.Object
com.ssgllc.fish.config.mcp.McpConfigurationConfig.ConfigurationTools
Enclosing class:
McpConfigurationConfig

public static class McpConfigurationConfig.ConfigurationTools extends Object
Tool implementations for configuration and data-model introspection.

Backed by ConfigSearchService, ApplicationService, ValueSets, and AbstractAppCacheRefreshMessageProducer.

  • Field Details

    • mapper

      protected final com.fasterxml.jackson.databind.ObjectMapper mapper
  • Method Details

    • configSearch

      @Tool(name="config-search", description="Full-text search across all configuration items for an exact term.") public String configSearch(@ToolParam(description="Text term to search for") String term, @ToolParam(required=false,description="Config type filter; omit for all") String entityType, @ToolParam(required=false,description="Case-sensitive; defaults to false") Boolean caseSensitive, @ToolParam(required=false,description="Include blob/document content") Boolean includeExpensive, @ToolParam(required=false,description="Max matched paths per item") Integer maxOccurrencesPerPath, @ToolParam(required=false,description="0-indexed page; defaults to 0") Integer page, @ToolParam(required=false,description="Results per page; defaults to 50") Integer pageSize)
      Searches all Casetivity configuration item types for an exact text term and returns the matching items with the specific field paths containing the match. Results are paged; use page and pageSize for large result sets.
      Parameters:
      term - text to search for (exact substring, not regex)
      entityType - optional config type filter (e.g. viewdef, texttemplate)
      caseSensitive - if true, match is case-sensitive; default false
      includeExpensive - if true, also searches blob/document content; default false
      maxOccurrencesPerPath - maximum matched paths per config item; null means no limit
      page - 0-indexed page number; default 0
      pageSize - results per page; default 50
      Returns:
      paged JSON result with matched config items and their matching field paths
    • listEntityNames

      @Tool(name="list-entity-names", description="List all entity type names in the data model.") public String listEntityNames(@ToolParam(required=false,description="true=core, false=custom, omit=all") Boolean core, @ToolParam(required=false,description="Filter by entity category") String category)
      Lists all entity type names currently registered in the application data model. Optionally filters to core (platform-built-in) or custom (application-specific) entities and/or by category. Call this before get-entity-data-model to discover valid names.
      Parameters:
      core - true = core only, false = custom only, null = all
      category - optional category filter (e.g. business, system)
      Returns:
      JSON array of entity name strings
    • getEntityDataModel

      @Tool(name="get-entity-data-model", description="Get fields, types, value sets, and relationships for one or more entities.") public String getEntityDataModel(@ToolParam(description="Comma-separated entity names") String entityNames, @ToolParam(required=false,description="Relationship hops to follow (0-3)") Integer connectionDepth, @ToolParam(required=false,description="Include DB-level join metadata") Boolean includeRelationshipDetails)
      Returns the data model for the requested entities including field names, data types, value-set codes, and relationship metadata. Set connectionDepth > 0 to include related entities up to that many hops away (max 3).
      Parameters:
      entityNames - comma-separated entity names; at least one is required
      connectionDepth - BFS hop depth for following relationships; 0 = exact entities only
      includeRelationshipDetails - when true, includes DB-level join metadata
      Returns:
      JSON object keyed by entity name, each containing its field and relationship descriptors
    • getValueSet

      @Tool(name="get-value-set", description="Get all concepts in a value set by code.") public String getValueSet(@ToolParam(description="Value set code") String valueSetCode, @ToolParam(required=false,description="Include inactive concepts") Boolean includeInactive)
      Returns all concepts in a value set. Each concept includes its id, code, displayName, description, and active flag.
      Parameters:
      valueSetCode - value set code (e.g. GENDER, RACE)
      includeInactive - when true, includes inactive concepts; default false
      Returns:
      JSON array of concept objects
    • searchConcepts

      @Tool(name="search-concepts", description="Search concepts in a value set by substring match on code or display name.") public String searchConcepts(@ToolParam(description="Value set code") String valueSetCode, @ToolParam(description="Case-insensitive search substring") String searchText)
      Case-insensitive substring search across concept codes and display names in a value set. Use this when you know roughly what concept you need but not its exact code.
      Parameters:
      valueSetCode - value set code
      searchText - case-insensitive substring to match against code or displayName
      Returns:
      JSON array of matching concept objects
    • getApplicationDetails

      @Tool(name="get-application-details", description="Get environment name, feature flags, data source config, and active integrations.") public String getApplicationDetails()
      Returns a sanitized view of the application's runtime configuration node, sourced from ApplicationService.getAppConfigNode(). Sensitive values (passwords, tokens) are not included.
      Returns:
      JSON object with environment name, feature flags, data-source info, authentication providers, and other runtime settings
    • refreshCaches

      @Tool(name="refresh-caches", description="Trigger an application cache refresh, optionally scoped to one cache type.") public String refreshCaches(@ToolParam(required=false,description="Cache type; defaults to ALL") String cacheType)
      Publishes a cache refresh event via AbstractAppCacheRefreshMessageProducer.sendTopic(AppCacheType). The refresh is asynchronous — this tool returns immediately after publishing the event. The actual cache reload happens on the listener side (JMS, SNS, sync, or Weblogic, depending on the active cacheSyncProvider configuration).

      Valid cacheType values (see AppCacheType): Permission, EntityConfig, ValueSet, User, Process, NickName, FrontendIndex, PrintTemplate, Custom, ALL.

      Parameters:
      cacheType - cache scope to refresh; defaults to ALL when omitted
      Returns:
      JSON object {"status":"requested","cacheType":"<type>"}
    • toJson

      protected String toJson(Object value)
      Serializes value to a compact JSON string (no indent). Returns {"error":"serialization failed"} if serialization throws.
      Parameters:
      value - the object to serialize; may be null
      Returns:
      compact JSON string
    • bytesToString

      protected String bytesToString(byte[] bytes)
      Decodes a byte array to a UTF-8 string. Used to convert binary report output to a returnable string.
      Parameters:
      bytes - raw bytes
      Returns:
      decoded string
    • handleTool

      protected String handleTool(Callable<Object> action)
      Invokes action, serializes the result with toJson(java.lang.Object), and returns it. Any exception thrown by the action is caught and converted to a standard {"error":"<message>"} response via errorJson(java.lang.Exception). Use this in every @Tool method to eliminate identical try/catch boilerplate.
      Parameters:
      action - the tool logic to invoke; may throw any exception
      Returns:
      compact JSON string — the serialized result on success, or an error object on failure
    • errorJson

      protected String errorJson(Exception e)
      Produces a standard {"error":"<message>"} JSON response from an exception. Falls back to the simple class name when Throwable.getMessage() is null.
      Parameters:
      e - the exception to convert
      Returns:
      JSON error string