Package com.ssgllc.fish.config.mcp
Class McpDeveloperToolsConfig.DeveloperTools
java.lang.Object
com.ssgllc.fish.config.mcp.McpDeveloperToolsConfig.DeveloperTools
- Enclosing class:
McpDeveloperToolsConfig
Tool implementations for developer productivity.
Backed by ReportService,
SqlValidator,
CalculatedFieldService,
ConfigTestService,
BpmProcessInstanceService,
ApplicationService,
PerRequestDebugService, and
DebugLogCaptureService.
-
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.protected StringProduces a standard{"error":"<message>"}JSON response from an exception.executeTextTemplate(String textTemplateName, Map<String, Object> variables) getDebugLogs(String debugToken) protected StringhandleTool(Callable<Object> action) Invokesaction, serializes the result withtoJson(java.lang.Object), and returns it.listSpelFunctions(String filterText) setDebugLogging(Map<String, String> packageLevels) testAttributeExpression(String entityType, String entityId, String expression, String runAsUserLogin) testEntityLifecycleScript(String entityType, String entityId, String script, String lifecycleEvent, String scriptName) testFullReport(String name, String definition, String config) testMatchExpression(String entityType, String entityId, String potentialId, String matchExp, Double matchThreshold, Double notMatchThreshold) testMergeExpression(String entityType, String bestRecordId, String supplementalId, String mergeExpression, boolean evaluateAsBoolean) testProcessScript(String processInstanceId, String script, String scriptName) testSpelExpression(String entityType, String entityId, String calcExpression, String runAsUserLogin) protected StringSerializesvalueto a compact JSON string (no indent).validateReport(String name, String definition, String config) validateSql(String sql)
-
Field Details
-
mapper
protected final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Method Details
-
validateReport
@Tool(name="validate-report", description="Parse a report SQL template to extract parameters and output columns without executing.") public String validateReport(@ToolParam(description="Report name") String name, @ToolParam(description="SQL template with {{param|type|label|required}} placeholders") String definition, @ToolParam(required=false,description="JSON config string") String config) -
testReportOutput
@Tool(name="test-report-output", description="Execute a report SQL template with parameter values, returning up to 25 rows.") public String testReportOutput(@ToolParam(description="Report name") String name, @ToolParam(description="SQL template with {{param|type|label|required}} placeholders") String definition, @ToolParam(required=false,description="Parameter names to values") Map<String, Object> parameters, @ToolParam(required=false,description="JSON config string") String config) -
testFullReport
@Tool(name="test-full-report", description="Smoke-test a report with auto-generated dummy parameter values.") public String testFullReport(@ToolParam(description="Report name") String name, @ToolParam(description="SQL template") String definition, @ToolParam(required=false,description="JSON config string") String config) -
validateSql
-
testSpelExpression
@Tool(name="test-spel-expression", description="Evaluate a SpEL expression against an entity instance.") public String testSpelExpression(@ToolParam(description="Entity type name") String entityType, @ToolParam(description="Entity UUID") String entityId, @ToolParam(description="SpEL expression to evaluate") String calcExpression, @ToolParam(required=false,description="User login to impersonate") String runAsUserLogin) -
testMatchExpression
@Tool(name="test-match-expression", description="Score a dedup match expression between two entities of the same type.") public String testMatchExpression(@ToolParam(description="Entity type name") String entityType, @ToolParam(description="Primary entity UUID (.e)") String entityId, @ToolParam(description="Potential match UUID (.p)") String potentialId, @ToolParam(description="Match scoring expression") String matchExp, @ToolParam(description="MATCH threshold (0-100)") Double matchThreshold, @ToolParam(description="NOT_MATCH threshold (0-100)") Double notMatchThreshold) -
testMergeExpression
@Tool(name="test-merge-expression", description="Evaluate a merge survivorship expression between two entities (.b=best, .s=supplemental).") public String testMergeExpression(@ToolParam(description="Entity type name") String entityType, @ToolParam(description="Best/surviving record UUID (.b)") String bestRecordId, @ToolParam(description="Supplemental record UUID (.s)") String supplementalId, @ToolParam(description="Merge survivorship expression") String mergeExpression, @ToolParam(required=false,description="If true, returns boolean shouldKeepEntity") boolean evaluateAsBoolean) -
testAttributeExpression
@Tool(name="test-attribute-expression", description="Test a boolean attribute security expression against an entity instance.") public String testAttributeExpression(@ToolParam(description="Entity type name") String entityType, @ToolParam(description="Entity UUID") String entityId, @ToolParam(description="Boolean SpEL expression") String expression, @ToolParam(required=false,description="User login to impersonate") String runAsUserLogin) -
listSpelFunctions
-
executeGroovyScript
@Tool(name="execute-groovy-script", description="Execute a Groovy script with optional bound variables; Spring beans available implicitly.") public String executeGroovyScript(@ToolParam(description="Groovy script source code") String script, @ToolParam(required=false,description="Bound variable names to values") Map<String, Object> variables, @ToolParam(required=false,description="Script name for logging") String scriptName) -
executeTextTemplate
@Tool(name="execute-text-template", description="Execute a named TextTemplate Groovy script with optional bound variables.") public String executeTextTemplate(@ToolParam(description="TextTemplate name") String textTemplateName, @ToolParam(required=false,description="Bound variable names to values") Map<String, Object> variables) -
testEntityLifecycleScript
@Tool(name="test-entity-lifecycle-script", description="Test a Groovy script with lifecycle-event-bound variables for a real entity.") public String testEntityLifecycleScript(@ToolParam(description="Entity type name") String entityType, @ToolParam(description="Entity UUID for context") String entityId, @ToolParam(description="Groovy script source code") String script, @ToolParam(description="Lifecycle event name") String lifecycleEvent, @ToolParam(required=false,description="Script name for logging") String scriptName) -
testProcessScript
@Tool(name="test-process-script", description="Execute a Groovy script in a running process instance context (requires ROLE_SUPER).") public String testProcessScript(@ToolParam(description="Running process instance UUID") String processInstanceId, @ToolParam(description="Groovy script source code") String script, @ToolParam(required=false,description="Script name for logging") String scriptName) -
setDebugLogging
-
getDebugLogs
-
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
-