Class McpDeveloperToolsConfig.DeveloperTools

java.lang.Object
com.ssgllc.fish.config.mcp.McpDeveloperToolsConfig.DeveloperTools
Enclosing class:
McpDeveloperToolsConfig

public static class McpDeveloperToolsConfig.DeveloperTools extends Object
Tool implementations for developer productivity.

Backed by ReportService, SqlValidator, CalculatedFieldService, ConfigTestService, BpmProcessInstanceService, ApplicationService, PerRequestDebugService, and DebugLogCaptureService.

  • 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

      @Tool(name="validate-sql", description="Validate SQL table and column references against the data model.") public String validateSql(@ToolParam(description="SQL SELECT statement") String sql)
    • 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

      @Tool(name="list-spel-functions", description="List all registered SpEL #function() signatures with optional name filter.") public String listSpelFunctions(@ToolParam(required=false,description="Substring filter on function name") String filterText)
    • 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

      @Tool(name="set-debug-logging", description="Create a per-request debug token for specified package log levels.") public String setDebugLogging(@ToolParam(description="Package name to log level map") Map<String,String> packageLevels)
    • getDebugLogs

      @Tool(name="get-debug-logs", description="Retrieve captured debug log entries by token.") public String getDebugLogs(@ToolParam(description="Debug token from set-debug-logging") String debugToken)
    • 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