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.describeClass(String className) describeFunction(String functionName, String className) 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.listGroovyFunctions(String className, String filterText) listSpelFunctions(String className, 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 scriptLabel) testFullReport(String name, String definition, String config, String runAsUserLogin) 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 scriptLabel) testReportOutput(String name, String definition, Map<String, Object> parameters, String config, String runAsUserLogin) testSpelExpression(String entityType, String entityId, String calcExpression, String runAsUserLogin) protected StringSerializesvalueto a compact JSON string (no indent).validateReport(String name, String definition, String config, String runAsUserLogin) 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, @ToolParam(required=false,description="User login to impersonate") String runAsUserLogin) -
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, @ToolParam(required=false,description="User login to impersonate") String runAsUserLogin) -
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, @ToolParam(required=false,description="User login to impersonate") String runAsUserLogin) -
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) -
listSpelClasses
@Tool(name="list-spel-classes", description="List the classes callable from a SpEL expression, with a one-line summary each. Follow up with list-spel-functions for one class\'s functions.") public String listSpelClasses() -
listGroovyClasses
@Tool(name="list-groovy-classes", description="List the classes callable from a Groovy script, with a one-line summary each. Wider than the SpEL set: adds the published utilities and bean instance methods (see boundAs). Follow up with list-groovy-functions for one class\'s functions.") public String listGroovyClasses() -
listSpelFunctions
@Tool(name="list-spel-functions", description="List SpEL-callable functions with a one-line summary each. Requires className (from list-spel-classes) or filterText - the whole surface is several hundred functions. filterText matches a function\'s name or its summary. Call describe-function for one function\'s full documentation and usage examples.") public String listSpelFunctions(@ToolParam(required=false,description="Class simple or qualified name to scope to, e.g. DateUtil or f()") String className, @ToolParam(required=false,description="Substring matched against each function\'s name and its summary, e.g. \"email\"") String filterText) -
listGroovyFunctions
@Tool(name="list-groovy-functions", description="List Groovy-callable functions with a one-line summary each. Requires className (from list-groovy-classes) or filterText - the whole surface is several hundred functions. filterText matches a function\'s name or its summary. Call describe-function for one function\'s full documentation and usage examples.") public String listGroovyFunctions(@ToolParam(required=false,description="Class simple or qualified name to scope to, e.g. DateUtil or f()") String className, @ToolParam(required=false,description="Substring matched against each function\'s name and its summary, e.g. \"email\"") String filterText) -
describeClass
@Tool(name="describe-class", description="Full documentation for one callable class: both javadoc paragraphs, the Spring bean name Groovy reaches it through, and its public fields. Use when a class summary from a list call is not enough - several classes put a usage warning in the second paragraph, which the listings do not carry.") public String describeClass(@ToolParam(description="Class simple or qualified name, or f() for the builder root") String className) -
describeFunction
@Tool(name="describe-function", description="Full documentation for one SpEL or Groovy function: description, usage examples, parameters, return value and deprecation. Returns every match, since a bare name can be ambiguous across overloads and classes - narrow with className, and compare the signature on each result to pick an overload.") public String describeFunction(@ToolParam(description="Function name, e.g. getConceptFromCode") String functionName, @ToolParam(required=false,description="Class simple or qualified name to disambiguate") String className) -
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="Free-form label for logs, stack traces and the script audit event. NOT a TextTemplate name - use execute-text-template to run a registered template by name.") String scriptLabel) -
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="Free-form label for logs, stack traces and the script audit event. NOT a TextTemplate name - use execute-text-template to run a registered template by name.") String scriptLabel) -
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="Free-form label for logs, stack traces and the script audit event. NOT a TextTemplate name - use execute-text-template to run a registered template by name.") String scriptLabel) -
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
-