agora_get_payment_offers
Retrieve payment offers for a product on Agora MCP. Provide product details, shipping address, and user information to generate L402-compatible offers for purchase.
Instructions
Get the payment offers for a product in Agora. Some products do not have variants, in such cases use the product_id as variant_id too.
Before calling this tool, check if the user has already provided the shipping address and user information.
Otherwise, ask the user for the shipping address and user information.
If the user does not provide an `addressName`, use the `firstname` and `lastname` to populate it.
Args:
slug: The product slug.
product_id: The product ID as str delimited by escaped double quotes
variant_id: The product variant ID as str delimited by escaped double quotes
quantity: The quantity to purchase.
shipping_address: The shipping address.
user: The user information.
Example:
product_id = "\"1234567890\""
variant_id = "\"1234567890\""
shipping_address = {
"addressName": "John Doe",
"addressFirst": "123 Main St",
"city": "New York",
"state": "NY",
"country": "US",
"zipCode": "10001"
}
user = {
"firstname": "John",
"lastname": "Doe",
"email": "john@example.com",
}
Returns:
L402 offer that can be paid by L402-compatible clients.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| product_id | Yes | ||
| quantity | No | ||
| shipping_address | Yes | ||
| slug | Yes | ||
| user | Yes | ||
| variant_id | Yes |
Implementation Reference
- src/agora_mcp/server.py:78-124 (handler)The handler function decorated with @mcp.tool() registers and implements the agora_get_payment_offers tool. It calls Agora.buy_now to get payment offers and processes the response using handle_response.@mcp.tool() async def agora_get_payment_offers(slug: str, product_id: str , variant_id: str, shipping_address: Dict, user: Dict, quantity: int = 1) -> Dict: """ Get the payment offers for a product in Agora. Some products do not have variants, in such cases use the product_id as variant_id too. Before calling this tool, check if the user has already provided the shipping address and user information. Otherwise, ask the user for the shipping address and user information. If the user does not provide an `addressName`, use the `firstname` and `lastname` to populate it. Args: slug: The product slug. product_id: The product ID as str delimited by escaped double quotes variant_id: The product variant ID as str delimited by escaped double quotes quantity: The quantity to purchase. shipping_address: The shipping address. user: The user information. Example: product_id = "\\"1234567890\\"" variant_id = "\\"1234567890\\"" shipping_address = { "addressName": "John Doe", "addressFirst": "123 Main St", "city": "New York", "state": "NY", "country": "US", "zipCode": "10001" } user = { "firstname": "John", "lastname": "Doe", "email": "john@example.com", } Returns: L402 offer that can be paid by L402-compatible clients. """ response = get_agora().buy_now( slug=slug, product_id=product_id, variant_id=variant_id, quantity=quantity, shipping_address=shipping_address, user=user ) return handle_response(response)