Construct an AQL query using the items.find() domain with a compound filter: match on repo name, item type 'file', and use the $lt operator on stat.downloaded to filter by date
POST the query as plain text to the endpoint POST https://<ARTIFACTORY_URL>/artifactory/api/search/aql with the Content-Type header set to text/plain
Authenticate using a header token (X-JFrog-Art-Api: YOUR_TOKEN) or HTTP Basic Auth; anonymous access to AQL is not allowed
Parse the streaming JSON response which returns a results array of matching artifact objects including repo, path, name, size, and stat fields
Pipe the results into a script or jq to extract artifact paths and optionally feed them to a DELETE or move REST call for cleanup
Known gotchas
AQL stat fields such as stat.downloaded reflect the last download time; if an artifact has never been downloaded, the stat field may be absent, so use $eq null guards or an $or clause to catch never-downloaded items
The AQL endpoint streams results and does not paginate with standard query params; use the .limit() and .offset() AQL clauses within the query body itself to page large result sets
Users need the 'Search Artifacts' permission on the target repository; lack of this permission returns an empty result set without an error, which can be misleading
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp