pohoda_delete_address
Remove an address from the POHODA addressbook using its unique ID. This tool deletes specific address records from the accounting system's contact database.
Instructions
Delete an address from POHODA addressbook by ID. Requires the address ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Address ID to delete (required) |
Implementation Reference
- src/tools/addresses.ts:144-166 (handler)The implementation of the `pohoda_delete_address` tool, which uses `buildImportDoc` to construct the delete XML request and executes it against the Pohoda client.
server.tool( "pohoda_delete_address", "Delete an address from POHODA addressbook by ID. Requires the address ID.", { id: z.number().describe("Address ID to delete (required)"), }, async (params) => { try { const xml = buildImportDoc({ ico: client.ico }, (item) => { const adb = item.ele(NS.adb, "adb:addressbook").att("version", "2.0"); const actionType = adb.ele(NS.adb, "adb:actionType"); const del = actionType.ele(NS.adb, "adb:delete"); const filter = del.ele(NS.ftr, "ftr:filter"); filter.ele(NS.ftr, "ftr:id").txt(String(params.id)); }); const response = await client.sendXml(xml); const result = extractImportResult(parseResponse(response)); return result.success ? ok(`Address deleted successfully. ${result.message}`) : err(result.message); } catch (e) { return err((e as Error).message); } } );