Class StripePaymentTool

java.lang.Object
com.tnsai.mcp.stripe.StripePaymentTool

public class StripePaymentTool extends Object
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 intent
  • list_payments - List recent payments
  • get_balance - Get account balance
  • list_customers - List customers
  • create_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 Details

    • StripePaymentTool

      public StripePaymentTool(StripeMcpClient client)
      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

      public String getName()
      Returns the name of this tool.
      Returns:
      the tool name
    • getDescription

      public String 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 IOException
      Executes 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 fails
      IllegalArgumentException - if the operation is not supported
    • listOperations

      public List<String> listOperations()
      Lists all supported operations.
      Returns:
      unmodifiable list of operation names