Skip to main content
Glama

delete_invoice_payment_by_id_and_invoice_id

DestructiveIdempotent

Delete a payment associated with an invoice. Provide the invoice ID and payment ID to remove the payment record.

Instructions

Delete a payment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoice_idYesID of the parent resource
idYesID of the payment to delete

Implementation Reference

  • The tool handler registered via server.registerTool. It calls apiDelete on /invoices/{invoice_id}/payments/{id}, logs the response, and returns a formatted deletion result.
    server.registerTool(
      "delete_invoice_payment_by_id_and_invoice_id",
      {
        description: "Delete a payment.",
        annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
        inputSchema: {
          invoice_id: z.number().int().positive().describe("ID of the parent resource"),
          id: z.number().int().positive().describe("ID of the payment to delete"),
        },
      },
      async ({ invoice_id, id }) => {
        try {
          const record = await apiDelete<EduframeRecord>(`/invoices/${invoice_id}/payments/${id}`);
          void logResponse("delete_invoice_payment_by_id_and_invoice_id", { invoice_id, id }, record);
          return formatDelete(record, "payment");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Zod input schema for the tool: invoice_id (number) and id (number) as required positive integers.
    inputSchema: {
      invoice_id: z.number().int().positive().describe("ID of the parent resource"),
      id: z.number().int().positive().describe("ID of the payment to delete"),
    },
  • Registration function that calls server.registerTool for all payment tools including delete_invoice_payment_by_id_and_invoice_id.
    export function registerPaymentTools(server: McpServer): void {
  • Import of registerPaymentTools into the central tools index registration aggregator.
    import { registerPaymentTools } from "./payments";
  • The apiDelete helper function that performs the HTTP DELETE request used by the tool handler.
    export async function apiDelete<T>(path: string): Promise<T> {
      const { token } = getConfig();
      const url = buildUrl(path);
    
      const response = await fetch(url.toString(), {
        method: "DELETE",
        headers: buildHeaders(token),
      });
    
      return handleResponse<T>(response);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds no behavioral details beyond what annotations already provide (destructiveHint=true, idempotentHint=true). It does not describe the effects on related data or any side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very short (3 words), but it does not earn its place as it adds no new information beyond the tool name. It is concise but not effectively informative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity of the tool (delete with two IDs), the description is lacking. It does not clarify what happens upon deletion (e.g., permanent removal, impact on invoice), nor does it indicate success or error conditions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides descriptions for both parameters (invoice_id and id) with 100% coverage. The description does not add any additional semantic meaning beyond restating the action.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description "Delete a payment." is a tautology of the tool name, which already clearly states the action and target. It does not add any differentiation from sibling tools like other delete operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives (e.g., other delete tools or payment-related tools). No prerequisites or exclusions are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/martijnpieters/eduframe-mcp'

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