Class FileFolderServiceTools

java.lang.Object
org.saidone.restless.mcp.FileFolderServiceTools

public class FileFolderServiceTools extends Object
MCP tools backed by FileFolderServiceClient.
  • Constructor Details

    • FileFolderServiceTools

      public FileFolderServiceTools()
  • Method Details

    • listChildren

      @Tool(name="alfresco_list_children", description="Lists the files and folders contained in an Alfresco folder, sorted by name, with paging. Start from -root- (Company Home), -my- (user home) or -shared- (Shared Files). \'totalItems\' is the number of children (-1 if unknown); while \'hasMoreItems\' is true, increase skipCount by the page size to read the next page.") public String listChildren(@ToolParam(description="Folder to list: 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="Number of items to skip (paging offset), 0 for the first page",required=false) Integer skipCount, @ToolParam(description="Page size, 1..1000 (default 100)",required=false) Integer maxItems)
      Lists readable children in name order.
      Parameters:
      nodeRef - folder reference, bare ID or repository alias
      skipCount - page offset, default zero
      maxItems - page size, default 100
      Returns:
      the JSON page with continuation information
    • createFolder

      @Tool(name="alfresco_create_folder", description="Creates a folder in Alfresco and returns it. Fails with ALREADY_EXISTS if the parent already contains a node with the same name.") public String createFolder(@ToolParam(description="Parent folder: a nodeRef, a bare node id or an alias (-root-, -my-, -shared-)") String parentRef, @ToolParam(description="Folder name") String name, @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)
      Creates a folder below the supplied parent.
      Parameters:
      parentRef - destination folder reference, bare ID or alias
      name - name of the new folder
      properties - optional typed properties
      Returns:
      the created folder as JSON
    • createDocument

      @Tool(name="alfresco_create_document", description="Creates a document in an Alfresco folder and returns it. Pass text content in \'content\', or binary content base64-encoded in \'contentBase64\' (not both). The mimetype is guessed from the name extension unless given. Fails with ALREADY_EXISTS if the name is taken.") public String createDocument(@ToolParam(description="Parent folder: a nodeRef, a bare node id or an alias (-root-, -my-, -shared-)") String parentRef, @ToolParam(description="Document name including the extension, e.g. notes.md") String name, @ToolParam(description="Text content (UTF-8)",required=false) String content, @ToolParam(description="Binary content encoded in base64",required=false) String contentBase64, @ToolParam(description="Mimetype, e.g. text/markdown; guessed from the name when omitted",required=false) String mimetype, @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)
      Creates a document with optional text or binary content.
      Parameters:
      parentRef - destination folder reference, bare ID or alias
      name - name of the new document
      content - optional UTF-8 text
      contentBase64 - optional base64 bytes, exclusive with text
      mimetype - explicit MIME type, or null to infer it from the name
      properties - optional typed properties
      Returns:
      the created document as JSON
    • moveNode

      @Tool(name="alfresco_move_node", description="Moves a document or folder into another folder, optionally renaming it, and returns it.") public String moveNode(@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="Destination folder: a nodeRef, a bare node id or an alias (-root-, -my-, -shared-)") String targetParentRef, @ToolParam(description="New name, omit to keep the current one",required=false) String name)
      Moves a node into a destination folder.
      Parameters:
      nodeRef - source node
      targetParentRef - destination folder
      name - optional replacement name
      Returns:
      the moved node as JSON
    • copyNode

      @Tool(name="alfresco_copy_node", description="Copies a document or folder (with all its content) into a folder, optionally with a new name, and returns the copy.") public String copyNode(@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="Destination folder: a nodeRef, a bare node id or an alias (-root-, -my-, -shared-)") String targetParentRef, @ToolParam(description="Name of the copy, omit to keep the original name",required=false) String name)
      Copies a node into a destination folder.
      Parameters:
      nodeRef - source node
      targetParentRef - destination folder
      name - optional name for the copy
      Returns:
      the copied node as JSON