getAllAccountingItems
Retrieve all accounting items like charges and payments from Mews MCP by applying filters such as item IDs, date ranges, or customer IDs to access specific financial data.
Instructions
Returns all accounting items (charges, payments, etc.) based on filter parameters. REQUIRED: At least one of the following filters must be specified: AccountingItemIds, RebatedItemIds, ClosedUtc, ConsumedUtc, or UpdatedUtc.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| AccountingItemIds | No | Filter by specific item IDs (one of the required filters) | |
| RebatedItemIds | No | Filter by rebated item IDs (one of the required filters) | |
| CustomerIds | No | Filter by customer IDs | |
| BillIds | No | Filter by bill IDs | |
| AccountingCategoryIds | No | Filter by accounting category IDs | |
| ConsumedUtc | No | Date range filter for item consumption (one of the required filters) | |
| ClosedUtc | No | Date range filter for when items were closed (one of the required filters) | |
| UpdatedUtc | No | Date range filter for when items were last updated (one of the required filters) | |
| CreatedUtc | No | Date range filter for item creation | |
| States | No | Filter by item states | |
| Limitation | No | Pagination settings |
Implementation Reference
- The main handler function that executes the tool by preparing request data with a default limitation and calling the Mews API endpoint '/api/connector/v1/accountingItems/getAll' via mewsRequest utility.async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> { const inputArgs = args as Record<string, unknown>; const requestData = { Limitation: { Count: 100 }, ...inputArgs }; const result = await mewsRequest(config, '/api/connector/v1/accountingItems/getAll', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- The inputSchema defining validation and structure for tool parameters, including various filters (some required) and pagination options.inputSchema: { type: 'object', properties: { AccountingItemIds: { type: 'array', items: { type: 'string' }, description: 'Filter by specific item IDs (one of the required filters)', maxItems: 1000 }, RebatedItemIds: { type: 'array', items: { type: 'string' }, description: 'Filter by rebated item IDs (one of the required filters)', maxItems: 1000 }, CustomerIds: { type: 'array', items: { type: 'string' }, description: 'Filter by customer IDs', maxItems: 1000 }, BillIds: { type: 'array', items: { type: 'string' }, description: 'Filter by bill IDs', maxItems: 1000 }, AccountingCategoryIds: { type: 'array', items: { type: 'string' }, description: 'Filter by accounting category IDs', maxItems: 1000 }, ConsumedUtc: { type: 'object', properties: { StartUtc: { type: 'string', description: 'Start of consumption date range (ISO 8601)' }, EndUtc: { type: 'string', description: 'End of consumption date range (ISO 8601)' } }, description: 'Date range filter for item consumption (one of the required filters)' }, ClosedUtc: { type: 'object', properties: { StartUtc: { type: 'string', description: 'Start of closed date range (ISO 8601)' }, EndUtc: { type: 'string', description: 'End of closed date range (ISO 8601)' } }, description: 'Date range filter for when items were closed (one of the required filters)' }, UpdatedUtc: { type: 'object', properties: { StartUtc: { type: 'string', description: 'Start of update date range (ISO 8601)' }, EndUtc: { type: 'string', description: 'End of update date range (ISO 8601)' } }, description: 'Date range filter for when items were last updated (one of the required filters)' }, CreatedUtc: { type: 'object', properties: { StartUtc: { type: 'string', description: 'Start of creation date range (ISO 8601)' }, EndUtc: { type: 'string', description: 'End of creation date range (ISO 8601)' } }, description: 'Date range filter for item creation' }, States: { type: 'array', items: { type: 'string' }, description: 'Filter by item states' }, Limitation: { type: 'object', properties: { Count: { type: 'number', description: 'Maximum number of items to return' }, Cursor: { type: 'string', description: 'Pagination cursor for next page' } }, description: 'Pagination settings' } }, additionalProperties: false },
- src/tools/index.ts:122-122 (registration)Registration of the tool in the central allTools array exported from index.ts, which is used to build the toolMap for execution and definitions.getAllAccountingItemsTool,
- src/tools/index.ts:37-37 (registration)Import statement that brings the getAllAccountingItemsTool into the index.ts for registration in allTools.import { getAllAccountingItemsTool } from './finance/getAllAccountingItems.js';