Package com.ssgllc.fish.config.mcp
Class McpConfigurationConfig.ConfigurationTools
java.lang.Object
com.ssgllc.fish.config.mcp.McpConfigurationConfig.ConfigurationTools
- Enclosing class:
McpConfigurationConfig
Tool implementations for configuration and data-model introspection.
Backed by ConfigSearchService,
ApplicationService,
ValueSets, and
AbstractAppCacheRefreshMessageProducer.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.fasterxml.jackson.databind.ObjectMapper -
Method Summary
Modifier and TypeMethodDescriptionprotected StringbytesToString(byte[] bytes) Decodes a byte array to a UTF-8 string.configSearch(String term, String entityType, Boolean caseSensitive, Boolean includeExpensive, Integer maxOccurrencesPerPath, Integer page, 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.protected StringProduces a standard{"error":"<message>"}JSON response from an exception.Returns a sanitized view of the application's runtime configuration node, sourced fromApplicationService.getAppConfigNode().getEntityDataModel(String entityNames, Integer connectionDepth, Boolean includeRelationshipDetails) Returns the data model for the requested entities including field names, data types, value-set codes, and relationship metadata.getValueSet(String valueSetCode, Boolean includeInactive) Returns all concepts in a value set.protected StringhandleTool(Callable<Object> action) Invokesaction, serializes the result withtoJson(java.lang.Object), and returns it.listEntityNames(Boolean core, String category) Lists all entity type names currently registered in the application data model.refreshCaches(String cacheType) Publishes a cache refresh event viaAbstractAppCacheRefreshMessageProducer.sendTopic(AppCacheType).searchConcepts(String valueSetCode, String searchText) Case-insensitive substring search across concept codes and display names in a value set.protected StringSerializesvalueto a compact JSON string (no indent).
-
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; usepageandpageSizefor large result sets.- Parameters:
term- text to search for (exact substring, not regex)entityType- optional config type filter (e.g.viewdef,texttemplate)caseSensitive- iftrue, match is case-sensitive; defaultfalseincludeExpensive- iftrue, also searches blob/document content; defaultfalsemaxOccurrencesPerPath- maximum matched paths per config item;nullmeans no limitpage- 0-indexed page number; default 0pageSize- 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 beforeget-entity-data-modelto discover valid names.- Parameters:
core-true= core only,false= custom only,null= allcategory- 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. SetconnectionDepth> 0 to include related entities up to that many hops away (max 3).- Parameters:
entityNames- comma-separated entity names; at least one is requiredconnectionDepth- BFS hop depth for following relationships; 0 = exact entities onlyincludeRelationshipDetails- whentrue, 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 itsid,code,displayName,description, andactiveflag.- Parameters:
valueSetCode- value set code (e.g.GENDER,RACE)includeInactive- whentrue, includes inactive concepts; defaultfalse- 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 codesearchText- 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 fromApplicationService.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 viaAbstractAppCacheRefreshMessageProducer.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 activecacheSyncProviderconfiguration).Valid
cacheTypevalues (seeAppCacheType):Permission,EntityConfig,ValueSet,User,Process,NickName,FrontendIndex,PrintTemplate,Custom,ALL.- Parameters:
cacheType- cache scope to refresh; defaults toALLwhen omitted- Returns:
- JSON object
{"status":"requested","cacheType":"<type>"}
-
toJson
Serializesvalueto a compact JSON string (no indent). Returns{"error":"serialization failed"}if serialization throws.- Parameters:
value- the object to serialize; may benull- Returns:
- compact JSON string
-
bytesToString
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
Invokesaction, serializes the result withtoJson(java.lang.Object), and returns it. Any exception thrown by the action is caught and converted to a standard{"error":"<message>"}response viaerrorJson(java.lang.Exception). Use this in every@Toolmethod 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
Produces a standard{"error":"<message>"}JSON response from an exception. Falls back to the simple class name whenThrowable.getMessage()is null.- Parameters:
e- the exception to convert- Returns:
- JSON error string
-