Skip to main content
Glama

deletePaymentInstruction

Remove a specific x402 payment instruction from the Pinata MCP server by providing its unique identifier to manage payment records.

Instructions

Delete an x402 payment instruction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe unique identifier of the payment instruction to delete

Implementation Reference

  • The complete implementation of the deletePaymentInstruction tool - registers the tool with its schema and defines the handler that makes a DELETE request to Pinata's x402 payment instructions API
    server.tool(
      "deletePaymentInstruction",
      "Delete an x402 payment instruction",
      {
        id: z
          .string()
          .describe("The unique identifier of the payment instruction to delete"),
      },
      async ({ id }) => {
        try {
          const url = `https://api.pinata.cloud/v3/x402/payment_instructions/${id}`;
    
          const response = await fetch(url, {
            method: "DELETE",
            headers: getHeaders(),
          });
    
          if (!response.ok) {
            throw new Error(
              `Failed to delete payment instruction: ${response.status} ${response.statusText}`
            );
          }
    
          const data = await response.json();
          return {
            content: [
              {
                type: "text",
                text: `✅ Payment instruction deleted successfully\n\n${JSON.stringify(data, null, 2)}`,
              },
            ],
          };
        } catch (error) {
          return errorResponse(error);
        }
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PinataCloud/pinata-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server