pohoda_list_offers
Retrieve and filter business offers from POHODA accounting software by type, ID, date range, company name, or last changes.
Instructions
List offers from POHODA. Supports filtering by offer type (issued/received), ID, date range, company name, or last changes. Returns JSON array of matching offer records.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offerType | No | Filter by offer type (issuedOffer or receivedOffer) | |
| id | No | Filter by offer ID | |
| dateFrom | No | Filter from date (DD.MM.YYYY or YYYY-MM-DD) | |
| dateTill | No | Filter till date (DD.MM.YYYY or YYYY-MM-DD) | |
| companyName | No | Filter by company name | |
| lastChanges | No | Filter by last changes date |
Implementation Reference
- src/tools/offers.ts:22-32 (registration)The tool 'pohoda_list_offers' is registered here with its schema definition within the registerOfferTools function.
server.tool( "pohoda_list_offers", "List offers from POHODA. Supports filtering by offer type (issued/received), ID, date range, company name, or last changes. Returns JSON array of matching offer records.", { offerType: offerTypeEnum.optional().describe("Filter by offer type (issuedOffer or receivedOffer)"), id: z.number().optional().describe("Filter by offer ID"), dateFrom: z.string().optional().describe("Filter from date (DD.MM.YYYY or YYYY-MM-DD)"), dateTill: z.string().optional().describe("Filter till date (DD.MM.YYYY or YYYY-MM-DD)"), companyName: z.string().optional().describe("Filter by company name"), lastChanges: z.string().optional().describe("Filter by last changes date"), }, - src/tools/offers.ts:33-59 (handler)The handler implementation for 'pohoda_list_offers' which builds the XML request, sends it to the Pohoda client, and parses the response.
async (params) => { try { const xml = buildExportRequest( { ico: client.ico }, "lst:listOfferRequest", NS.lst, "lst:requestOffer", (req) => { if (params.offerType) req.att("offerType", params.offerType); const filterParams: ListFilterParams = { id: params.id, dateFrom: params.dateFrom, dateTill: params.dateTill, companyName: params.companyName, lastChanges: params.lastChanges, }; applyFilter(req, filterParams); } ); const response = await client.sendXml(xml); const parsed = parseResponse(response); const data = extractListData(parsed); return jsonResult("Offers", data, Array.isArray(data) ? data.length : 0); } catch (e) { return err((e as Error).message); } }