Package com.tnsai.mcp.stripe
Class StripePaymentTool
java.lang.Object
com.tnsai.mcp.stripe.StripePaymentTool
Adapter that wraps
StripeMcpClient as a tool-like interface.
This does not extend AbstractTool since we are in the tnsai-mcp module, but it provides a similar interface for executing Stripe operations by name.
Supported operations:
create_payment_intent- Create a payment intentlist_payments- List recent paymentsget_balance- Get account balancelist_customers- List customerscreate_customer- Create a customer
Example usage:
StripePaymentTool tool = new StripePaymentTool(stripeMcpClient);
JsonNode result = tool.execute("get_balance", Map.of());
List<String> ops = tool.listOperations();
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStripePaymentTool(StripeMcpClient client) Creates a new StripePaymentTool with the given Stripe MCP client. -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNodeExecutes a Stripe operation by name.Returns a description of this tool.getName()Returns the name of this tool.Lists all supported operations.
-
Constructor Details
-
StripePaymentTool
Creates a new StripePaymentTool with the given Stripe MCP client.- Parameters:
client- the Stripe MCP client- Throws:
IllegalArgumentException- if client is null
-
-
Method Details
-
getName
Returns the name of this tool.- Returns:
- the tool name
-
getDescription
Returns a description of this tool.- Returns:
- the tool description
-
execute
public com.fasterxml.jackson.databind.JsonNode execute(String operation, Map<String, Object> params) throws IOExceptionExecutes a Stripe operation by name.- Parameters:
operation- the operation name (e.g., "get_balance", "create_customer")params- the operation parameters- Returns:
- the result as JSON
- Throws:
IOException- if the operation failsIllegalArgumentException- if the operation is not supported
-
listOperations
Lists all supported operations.- Returns:
- unmodifiable list of operation names
-