Package com.tnsai.tools.commerce
Class EtsyTools
java.lang.Object
com.tnsai.tools.commerce.EtsyTools
Function-shape Etsy tools — Open API v3 (read-only). Replaces the legacy
EtsyACPTool (single dispatched tool). Splits the most-useful
subset of the legacy operations (search/listing/shop) into typed @Tool
methods. Cart / checkout / favorites can be added piecewise as real
consumers need them.
| Method | Endpoint | Idempotent |
|---|---|---|
etsySearch(java.lang.String, int) | GET /application/listings/active | true |
etsyGetListing(long) | GET /application/listings/{id} | true |
etsyGetShop(java.lang.String) | GET /application/shops/{id} | true |
Requires ETSY_API_KEY. Sign up at
developers.etsy.com/documentation/.
- Since:
- 0.5.7 (Phase 2 batch 14a — built-in tool migration to function shape, see #188)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionetsyGetListing(long listingId) etsyGetShop(String shopId) etsySearch(String keywords, int limit)
-
Constructor Details
-
EtsyTools
public EtsyTools()Default constructor — picks ETSY_API_KEY from env. -
EtsyTools
Explicit-key constructor. -
EtsyTools
public EtsyTools(String apiKey, okhttp3.OkHttpClient http, com.fasterxml.jackson.databind.ObjectMapper mapper) Full constructor for tests / shared HTTP.
-
-
Method Details
-
etsySearch
@Tool(name="etsy_search", description="Search active Etsy listings by free-text {keywords}. {limit} clamps to [1, 100]. Returns the raw JSON response from Etsy (results array under \"results\"). Requires ETSY_API_KEY.", keywords={"etsy","handmade","vintage","craft","marketplace","search"}, idempotent=true) public String etsySearch(@ToolParam(description="Free-text search keywords") String keywords, @ToolParam(description="Max results (1..100); 0 \u2192 default 10",required=false,defaultValue="0") int limit) throws IOException - Throws:
IOException
-
etsyGetListing
@Tool(name="etsy_get_listing", description="Fetch a single Etsy listing by id, including images, shop, and inventory. Returns the raw JSON. Requires ETSY_API_KEY.", keywords={"etsy","listing","product","detail"}, idempotent=true) public String etsyGetListing(@ToolParam(description="Etsy listing id (positive integer)") long listingId) throws IOException - Throws:
IOException
-
etsyGetShop
@Tool(name="etsy_get_shop", description="Fetch an Etsy shop\'s public profile (name, listings, sales, rating). Returns the raw JSON. Requires ETSY_API_KEY.", keywords={"etsy","shop","store","profile"}, idempotent=true) public String etsyGetShop(@ToolParam(description="Etsy shop id") String shopId) throws IOException - Throws:
IOException
-