Tool tree
A small e-commerce demo built with Next.js and exposed to AI agents via WebMCP.
Implementation
gradeNot graded
gradeNot graded
search_productsAnswer
Search the store catalog by free-text query and/or a price range. Returns matching products with id, name, price, category, and description.
View tool JSON
{
"name": "search_products",
"kind": "answer",
"impl": "imperative",
"description": "Search the store catalog by free-text query and/or a price range. Returns matching products with id, name, price, category, and description.",
"inputSchema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Free-text search across product name, description, and category."
},
"minPrice": {
"type": "number",
"description": "Minimum price in USD, inclusive."
},
"maxPrice": {
"type": "number",
"description": "Maximum price in USD, inclusive."
},
"category": {
"type": "string",
"enum": [
"audio",
"kitchen",
"outdoors",
"desk"
],
"description": "Restrict results to a single category."
}
}
}
}get_productAnswer
Fetch full details for a single product by its id.
View tool JSON
{
"name": "get_product",
"kind": "answer",
"impl": "imperative",
"description": "Fetch full details for a single product by its id.",
"inputSchema": {
"type": "object",
"properties": {
"productId": {
"type": "string",
"description": "The product id, e.g. 'aud-01'."
}
},
"required": [
"productId"
]
}
}add_to_cartAction
Add a quantity of a product to the shopping cart. Use search_products first to find a valid productId.
View tool JSON
{
"name": "add_to_cart",
"kind": "act",
"impl": "imperative",
"description": "Add a quantity of a product to the shopping cart. Use search_products first to find a valid productId.",
"inputSchema": {
"type": "object",
"properties": {
"productId": {
"type": "string",
"description": "The product id to add."
},
"quantity": {
"type": "number",
"description": "How many units to add (default 1).",
"minimum": 1
}
},
"required": [
"productId"
]
}
}remove_from_cartAction
Remove a product from the cart. If quantity is omitted, removes the item entirely regardless of its current quantity.
View tool JSON
{
"name": "remove_from_cart",
"kind": "act",
"impl": "imperative",
"description": "Remove a product from the cart. If quantity is omitted, removes the item entirely regardless of its current quantity.",
"inputSchema": {
"type": "object",
"properties": {
"productId": {
"type": "string",
"description": "The product id to remove."
},
"quantity": {
"type": "number",
"description": "How many units to remove. Omit to remove all units of this product.",
"minimum": 1
}
},
"required": [
"productId"
]
}
}get_cartAnswer
Get the current cart contents: each line item with quantity and line total, plus the item count and subtotal.
View tool JSON
{
"name": "get_cart",
"kind": "answer",
"impl": "imperative",
"description": "Get the current cart contents: each line item with quantity and line total, plus the item count and subtotal.",
"inputSchema": {
"type": "object",
"properties": {}
}
}