Skill: Query GL Detail
Query general ledger detail records in Sage Intacct with mandatory date ranges, module and journal filters, and dimensional groupings.
The Query GL Detail skill retrieves aggregated general ledger detail records from Sage Intacct. This is the primary skill for answering questions about journal entries, account balances, and ledger activity across any dimension.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
group_by | string | Yes | How to group results. Options: glaccount, department, location, vendor, customer, project, class, item, employee. Multiple values can be comma-separated. |
start_date | string | Yes | Start of the date range on BATCH_DATE (YYYY-MM-DD). GL detail queries require a date range. |
end_date | string | Yes | End of the date range on BATCH_DATE (YYYY-MM-DD). |
module_key | string | No | Filter by module (e.g., 2.AP for Accounts Payable, 3.AR for Accounts Receivable, 1.GL for General Ledger). |
book_id | string | No | Filter by book ID. Use ACCRUAL or CASH to select the accounting basis, or a custom book ID. |
journal_symbol | string | No | Filter by journal symbol (e.g., APJ for AP Journal, ARJ for AR Journal, GJ for General Journal). |
glaccount | string | No | Filter by GL account number. |
department_id | string | No | Filter by department ID. |
location_id | string | No | Filter by location ID. |
vendor_id | string | No | Filter by vendor ID. |
customer_id | string | No | Filter by customer ID. |
project_id | string | No | Filter by project ID. |
class_id | string | No | Filter by class ID. |
employee_id | string | No | Filter by employee ID. |
offset | integer | No | Number of records to skip for pagination. Defaults to 0. |
limit | integer | No | Maximum number of grouped records to return. Defaults to 100. |
Both start_date and end_date are mandatory for GL detail queries. The date filter applies to BATCH_DATE (the date the journal entry was posted). If the user does not specify dates, the agent should default to a reasonable range such as the current fiscal year or month.
Aggregates
The skill automatically computes these aggregates for each group:
| Aggregate | Description |
|---|---|
SUM(AMOUNT) | Net amount (debits positive, credits negative) in base currency. |
SUM(TRX_AMOUNT) | Net amount in transaction currency. |
COUNT(RECORDNO) | Number of GL detail records in the group. |
Example usage
“What’s the GL activity for each department this month?”
The agent would invoke:
group_by:departmentstart_date:2026-03-01end_date:2026-03-18
“Show me all AP journal entries to account 6000 in Q4 last year.”
The agent would invoke:
group_by:glaccountstart_date:2025-10-01end_date:2025-12-31module_key:2.APglaccount:6000
Response structure
The skill returns an array of grouped records, each containing:
- Group key(s) — the dimension value(s) used for grouping.
- SUM_AMOUNT — net base-currency amount for the group.
- SUM_TRX_AMOUNT — net transaction-currency amount.
- COUNT_RECORDNO — number of journal entry lines in the group.
Related skills: Query GL Budget Items | Query AP Bill Items | Query AR Invoice Items