paisa-mcp 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +16 -6
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -42554,18 +42554,28 @@ function registerDebtTools(server, client) {
|
|
|
42554
42554
|
dueDate: exports_external.string().optional().describe("YYYY-MM-DD"),
|
|
42555
42555
|
notes: exports_external.string().optional()
|
|
42556
42556
|
}
|
|
42557
|
-
}, async (
|
|
42558
|
-
const
|
|
42557
|
+
}, async ({ name, amount, type, dueDate, notes }) => {
|
|
42558
|
+
const notesWithDue = dueDate ? [notes, `Due: ${dueDate}`].filter(Boolean).join(" — ") : notes;
|
|
42559
|
+
const data = await client.post("/api/debts", {
|
|
42560
|
+
name,
|
|
42561
|
+
direction: type,
|
|
42562
|
+
type: "other",
|
|
42563
|
+
outstandingBalance: amount,
|
|
42564
|
+
...notesWithDue ? { notes: notesWithDue } : {}
|
|
42565
|
+
});
|
|
42559
42566
|
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
42560
42567
|
});
|
|
42561
42568
|
server.registerTool("settle_debt", {
|
|
42562
|
-
description: "Mark a debt as settled.",
|
|
42569
|
+
description: "Mark a debt as settled (soft-deactivates it; zeroes the balance).",
|
|
42563
42570
|
inputSchema: {
|
|
42564
42571
|
id: exports_external.string(),
|
|
42565
42572
|
settledAmount: exports_external.string().optional().describe("Actual settled amount if different")
|
|
42566
42573
|
}
|
|
42567
|
-
}, async ({ id,
|
|
42568
|
-
const data = await client.patch(`/api/debts/${id}`, {
|
|
42574
|
+
}, async ({ id, settledAmount }) => {
|
|
42575
|
+
const data = await client.patch(`/api/debts/${id}`, {
|
|
42576
|
+
isActive: false,
|
|
42577
|
+
outstandingBalance: settledAmount ?? "0"
|
|
42578
|
+
});
|
|
42569
42579
|
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
42570
42580
|
});
|
|
42571
42581
|
}
|
|
@@ -46311,5 +46321,5 @@ main().catch((err) => {
|
|
|
46311
46321
|
process.exit(1);
|
|
46312
46322
|
});
|
|
46313
46323
|
|
|
46314
|
-
//# debugId=
|
|
46324
|
+
//# debugId=1EEBC94B29D2067F64756E2164756E21
|
|
46315
46325
|
//# sourceMappingURL=index.js.map
|