Overview
The Products API provides complete CRUD operations for managing an e-commerce product catalog. Returns ProductInstance objects with direct property access.Direct Access
Access properties with
product.name not product.data.nameArray Methods
Use
.map(), .filter() on search resultsInstance Methods
Built-in
update(), save(), and delete()Iteration
Use
for...of loopsReturn Shape Reference
Quick examples:
Methods
search()
Search products by name or description using semantic search.string
required
Search query to match against product names and descriptions
ProductSearchInstance - Array-like collection with direct access to products via .products property
Example:
get()
Retrieve products with pagination and optional filtering.number
default:1
Page number (1-indexed)
number
default:10
Number of products per page
object
MongoDB-style filter object to query product data fields
ProductPaginationInstance - Array-like collection with pagination support
Examples:
getById()
Get a specific product by ID.ProductInstance with direct property access and methods
Example:
create()
Create a new product.string
required
Product name
number
required
Product price
string
Product category
string
Stock keeping unit
boolean
default:true
Whether product is in stock
string
Product description
ProductInstance with direct property access and methods
Example:
update() (Instance Method)
Update an existing product via an instance. Useproduct.update() on a retrieved product — there is no static Products.update() method.
object
required
Partial product data to update
save() (Instance Method)
Save the current state of the product to the server. This is a convenience method that persists all changes made to the product instance.true if successful
Example:
New in Latest Version: The
save() method provides a simpler workflow - modify properties then save, rather than calling Products.update() with the product ID.delete()
Delete a product.ProductInstance
All product methods returnProductInstance objects with:
Direct Property Access:
Complete Examples
Search Tool
Create Product Tool
Update Stock Tool
Use Cases
E-commerce Catalog
Inventory Management
Filtering Products
Product Recommendations
Search vs Filter
- When to Use Search
- When to Use Filter
Use
Products.search() for semantic/fuzzy matching:- “laptop for students”
- “wireless headphones”
- Natural language queries
Best Practices
Validate Products Exist
Validate Products Exist
Always check if product exists:
Check Stock Before Adding to Cart
Check Stock Before Adding to Cart
Format Prices for Display
Format Prices for Display
Handle Search with No Results
Handle Search with No Results
If product results don’t look right, log the raw return to see the actual shape:Then run
lua logs --type skill --limit 5 after a test message to inspect the output. See the Debugging Skills guide for the full workflow.Next Steps
Baskets API
Add products to shopping carts
Product Examples
See complete tool examples
Debugging Skills
Inspect runtime return values

