Class DesignableProjectTools
java.lang.Object
com.inductiveautomation.ignition.designer.ai.tool.DesignableProjectTools
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 Summary
ConstructorsConstructorDescriptionDesignableProjectTools(DesignableProject project) Creates a tool set bound to the given project. -
Method Summary
Modifier and TypeMethodDescriptionReturns a JSON array describing the direct children of a folder for the given resource type.Returns a JSON object describing the current project: name, title, description, and the inheritable / enabled flags.getResourcesForType(String typeString) Returns a JSON array of folder paths for every non-folder resource of the given type in the project.Reads a named data blob from the resource at the given path and returns it decoded as a UTF-8 string.readResourceMetadata(String typeString, String path) Returns a JSON object describing the resource at the given path.
-
Constructor Details
-
DesignableProjectTools
Creates a tool set bound to the given project.- Parameters:
project- the project whose resources will be inspected.
-
-
Method Details
-
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
-
browse
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 asmoduleId/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
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 asmoduleId/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
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 asmoduleId/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.
-