Class DesignableProjectTools

java.lang.Object
com.inductiveautomation.ignition.designer.ai.tool.DesignableProjectTools

public class DesignableProjectTools extends Object
Tool methods for inspecting an in-memory DesignableProject. Each @Tool-annotated method is exposed to an AI agent via Tools and returns its result as a JSON string.
  • Constructor Details

    • DesignableProjectTools

      public DesignableProjectTools(DesignableProject project)
      Creates a tool set bound to the given project.
      Parameters:
      project - the project whose resources will be inspected.
  • Method Details

    • getProjectMetadata

      public String getProjectMetadata()
      Returns a JSON object describing the current project: name, title, description, and the inheritable / enabled flags.
      Returns:
      a JSON object of project metadata.
    • getResourcesForType

      public String getResourcesForType(String typeString)
      Returns a JSON array of folder paths for every non-folder resource of the given type in the project.
      Parameters:
      typeString - the resource type, formatted as moduleId/resourceTypeId.
      Returns:
      a JSON array of folder paths.
    • browse

      public String browse(String typeString, String folderPath)
      Returns a JSON array describing the direct children of a folder for the given resource type. Each entry includes its path, name, and whether it is itself a folder.
      Parameters:
      typeString - the resource type, formatted as moduleId/resourceTypeId.
      folderPath - the folder path to browse, or empty string for the type root.
      Returns:
      a JSON array of child resource descriptors, or an empty array if the folder does not exist.
    • readResourceMetadata

      public String readResourceMetadata(String typeString, String path)
      Returns a JSON object describing the resource at the given path. Includes the resource's data keys but not the data itself.
      Parameters:
      typeString - the resource type, formatted as moduleId/resourceTypeId.
      path - the folder path of the resource.
      Returns:
      a JSON object describing the resource.
      Throws:
      NoSuchElementException - if no resource exists at the given path.
    • readData

      public String readData(String typeString, String path, String dataKey)
      Reads a named data blob from the resource at the given path and returns it decoded as a UTF-8 string.
      Parameters:
      typeString - the resource type, formatted as moduleId/resourceTypeId.
      path - the folder path of the resource.
      dataKey - the name of the data blob to read.
      Returns:
      the contents of the data blob as a string.
      Throws:
      NoSuchElementException - if the resource or data blob does not exist.