Package org.saidone.restless.mcp
Class NodeServiceTools
java.lang.Object
org.saidone.restless.mcp.NodeServiceTools
MCP tools backed by NodeServiceClient.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeleteNode(String nodeRef) Moves a live node to the trashcan or permanently deletes an archived node.Reads a complete repository node snapshot.updateNode(String nodeRef, String name, String type, Map<String, PropertyInput> properties) Applies supplied metadata changes in one repository call.
-
Constructor Details
-
NodeServiceTools
public NodeServiceTools()
-
-
Method Details
-
getNode
@Tool(name="alfresco_get_node", description="Reads a node (document or folder) from the Alfresco repository: name, type, aspects and all properties. Accepts a nodeRef, a node id or an alias (-root-, -my-, -shared-).") public String getNode(@ToolParam(description="Node to read: a nodeRef (workspace://SpacesStore/<id>), a bare node id, or one of the aliases -root- (Company Home), -my- (user home folder), -shared- (Shared Files)") String nodeRef) Reads a complete repository node snapshot.- Parameters:
nodeRef- node reference, bare ID or repository alias- Returns:
- the snapshot as JSON
-
updateNode
@Tool(name="alfresco_update_node", description="Renames a node, changes its type and/or updates its metadata, then returns it. Only the given properties change; properties of aspects (e.g. cm:title) add the aspect automatically. The type change is applied before the properties, so properties of the new type can be set in the same call. Use alfresco_list_models to find the types and their properties.") public String updateNode(@ToolParam(description="Node to read: a nodeRef (workspace://SpacesStore/<id>), a bare node id, or one of the aliases -root- (Company Home), -my- (user home folder), -shared- (Shared Files)") String nodeRef, @ToolParam(description="New name, omit to keep the current one",required=false) String name, @ToolParam(description="New type, e.g. a custom document type; omit to keep the current one. A document must stay a cm:content subtype and a folder a cm:folder subtype",required=false) String type, @ToolParam(description="Optional typed metadata keyed by property name, e.g. {\"cm:title\":{\"multiValued\":false,\"values\":[{\"stringValue\":\"Budget\"}]}}. For lists use multiValued:true and zero or more typed values. Empty lists clear lists; {\"multiValued\":false,\"values\":[{\"nullValue\":true}]} clears a scalar. Omitted properties are unchanged. Each value has exactly one field: stringValue, integerValue, doubleValue, booleanValue, timestampMillis (epoch milliseconds), nodeRefValue or qnameValue. Types and cardinality must match the dictionary. Set the name with \'name\', never as cm:name.",required=false) Map<String, PropertyInput> properties) Applies supplied metadata changes in one repository call.- Parameters:
nodeRef- node reference, bare ID or repository aliasname- replacement name, or null to preserve ittype- replacement qualified type, or null to preserve itproperties- typed properties to merge- Returns:
- the updated snapshot as JSON
-
deleteNode
@Tool(name="alfresco_delete_node", description="Deletes a document or folder (with all its content) by moving it to the Alfresco trashcan, from where an administrator can restore it. A node already in the trashcan (archive://) is deleted permanently: use alfresco_purge_trashcan_node for that. Ask the user for confirmation before deleting.") public String deleteNode(@ToolParam(description="Node to read: a nodeRef (workspace://SpacesStore/<id>), a bare node id, or one of the aliases -root- (Company Home), -my- (user home folder), -shared- (Shared Files)") String nodeRef) Moves a live node to the trashcan or permanently deletes an archived node.- Parameters:
nodeRef- node reference, bare ID or repository alias- Returns:
- a deletion confirmation
-