transaction_delete
Remove unwanted or incorrect financial transactions from your Money Manager records to maintain accurate personal finance tracking.
Instructions
Deletes one or more transactions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | Yes | Array of transaction IDs to delete |
Implementation Reference
- src/tools/handlers.ts:290-312 (handler)The main handler function that validates input using TransactionDeleteInputSchema, formats transaction IDs for the Money Manager API, calls the /delete endpoint, and returns operation success status with deleted count./** * Handler for transaction_delete tool * Deletes one or more transactions */ export async function handleTransactionDelete( httpClient: HttpClient, input: unknown, ): Promise<TransactionOperationResponse> { const validated = TransactionDeleteInputSchema.parse(input); // Format IDs as colon-separated string (API expects ":id1:id2:id3" format) const idsString = ":" + validated.ids.join(":"); const response = await httpClient.post<ApiOperationResponse>("/delete", { ids: idsString, }); return { success: response.success !== false && response.result !== "fail", deletedCount: validated.ids.length, message: response.message, }; }
- src/schemas/index.ts:148-159 (schema)Zod schema defining the input: an array of non-empty transaction ID strings, requiring at least one ID./** * Input schema for transaction_delete tool */ export const TransactionDeleteInputSchema = z.object({ ids: z .array(TransactionIdSchema) .min(1, "At least one transaction ID is required"), }); export type TransactionDeleteInput = z.infer< typeof TransactionDeleteInputSchema >;
- src/index.ts:158-172 (registration)MCP tool definition in TOOL_DEFINITIONS array, including name, description, and basic JSON schema for input validation in the protocol.{ name: "transaction_delete", description: "Deletes one or more transactions.", inputSchema: { type: "object" as const, properties: { ids: { type: "array", items: { type: "string" }, description: "Array of transaction IDs to delete", }, }, required: ["ids"], }, },
- src/tools/handlers.ts:800-800 (registration)Maps the 'transaction_delete' tool name to its handler function in the toolHandlers registry, used by executeToolHandler.transaction_delete: handleTransactionDelete,
- src/schemas/index.ts:382-382 (registration)Registers the input schema in ToolSchemas object for validation lookup by tool name.transaction_delete: TransactionDeleteInputSchema,