pohoda_delete_contract
Delete a contract from POHODA accounting software by specifying its unique ID. This tool removes contracts from the system when they are no longer needed.
Instructions
Delete a contract from POHODA by ID. Requires the contract ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Contract ID to delete (required) |
Implementation Reference
- src/tools/contracts.ts:101-123 (handler)Implementation and registration of the 'pohoda_delete_contract' tool.
server.tool( "pohoda_delete_contract", "Delete a contract from POHODA by ID. Requires the contract ID.", { id: z.number().describe("Contract ID to delete (required)"), }, async (params) => { try { const xml = buildImportDoc({ ico: client.ico }, (item) => { const con = item.ele(NS.con, "con:contract").att("version", "2.0"); const actionType = con.ele(NS.con, "con:actionType"); const del = actionType.ele(NS.con, "con: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(`Contract deleted successfully. ${result.message}`) : err(result.message); } catch (e) { return err((e as Error).message); } } );