Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
SAGA_DBNoOne firm database (path as the Firebird server sees it).
SAGA_ROOTNoSAGA folder to scan for */cont_baza.fdb (must be readable from this computer).
SAGA_FIRMSNoSeveral firms in the form CODE=PATH;CODE=PATH.
ISC_PASSWORDNoAlternative to SAGA_FB_PASSWORD: Firebird password.
SAGA_FB_HOSTNoFirebird server host.127.0.0.1
SAGA_FB_PORTNoFirebird server port.3050
SAGA_FB_USERNoFirebird user.SYSDBA
SAGA_MAX_ROWSNoRow cap per call (max 5000).500
SAGA_BACKUP_DIRNoWhere backups before writes go (a folder on the database server). Defaults to the firm folder.
SAGA_FB_PASSWORDNoFirebird password (required; alternatively use ISC_PASSWORD).
SAGA_DEFAULT_FIRMNoFirm used when a tool call names none. Defaults to the first firm.
SAGA_FB_WIRECRYPTNoSet to 0 to disable Firebird wire encryption.on
SAGA_ALLOW_PAYROLLNoSet to 1 to allow payroll tables in saga_query (off by default).
SAGA_MCP_ENABLE_WRITESNoSet to 1 to enable the experimental write tools (off by default).
SAGA_SHOW_PERSONAL_IDSNoSet to 1 to disable CNP masking (off by default).
SAGA_FB_CONNECT_TIMEOUT_MSNoConnection timeout in milliseconds.10000

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Unofficial tools for SAGA C. accounting databases (Romania). Amounts are in RON unless stated. Start with saga_list_firms and saga_firm_info. Read tools never change data. Write tools are disabled on this server.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
saga_list_firmsA

Lists the SAGA firm databases this server can open (code and database path).

saga_firm_infoA

Overview of one firm: last closed period, VAT settings, ledger date range, record counts, Firebird version.

saga_list_accountsA

Accounts from the chart of accounts (planul de conturi), optionally filtered by prefix or by text in the name.

saga_trial_balanceA

Trial balance for a period: opening balance at 1 January, previous turnover, period turnover, totals and closing balance per account. level: synthetic (default; e.g. 401), analytic (as stored, e.g. 401.00012) or group3 (first 3 digits).

saga_account_ledgerA

All entries of one account in a period with opening balance, running balance and closing balance. match=account (default) includes analytic sub-accounts ("401" -> 401, 401.x); match=prefix takes every account starting with the text.

saga_journalA

Ledger entries (REGISTRU) in a period, filterable by source (FEL_D: Intrari, Iesiri, Casa, Banca, Inchidere, Salarii, ...), account, partner code, note id, document number or text.

saga_journal_sourcesB

Which kinds of ledger entries (FEL_D values) exist and their date ranges.

saga_partnersB

Search suppliers or customers by name or fiscal code. Personal numeric codes (CNP) are masked.

saga_open_invoicesA

Unpaid supplier invoices (kind=suppliers) or customer invoices (kind=customers), with due dates and days overdue. Foreign-currency invoices are included with currency and unpaid_currency. as_of (YYYY-MM-DD) gives the situation at a past date.

saga_partner_balancesB

Per supplier or customer: unpaid and overdue totals from open invoices, plus the general-ledger balance of the partner account for reconciliation.

saga_documentsA

Purchase (intrari) or sales (iesiri) documents in a period with totals. currency=true lists the foreign-currency ones instead (SAGA keeps them apart: purchases in INTRD, sales in EXPORT).

saga_documentA

One purchase or sales document: header, lines, the ledger entries it produced and the payments linked to it.

saga_stockC

Stock quantities (and an estimated value at cost) per warehouse (gestiune) and article at a date.

saga_stock_movementsB

Movements of one article (optionally one warehouse) in a period with running quantity.

saga_cash_bank_balancesA

Balances of all cash (531x) and bank (512x) accounts at a date.

saga_cash_bank_registerA

Register of one cash or bank account (e.g. 5311, 5121.1): opening balance, entries with running balance, closing balance.

saga_vat_summaryA

VAT accounts turnover (4426, 4427, 4428, 4423, 4424) and sales/purchases net and VAT by rate for a period. Not a D300 return.

saga_saft_checkA

Basic checks before D406: accounts used but missing from the chart or SAF-T mapping, partners without fiscal codes, unposted documents.

saga_list_tablesB

Tables in the SAGA database (about 195), optionally with row counts. Payroll tables are flagged.

saga_describe_tableA

Columns (name, type, default) and primary key of one table. Shows structure only, no data.

saga_queryA

Runs one SELECT (Firebird 3 SQL dialect) inside a READ ONLY transaction. Use FIRST/ROWS for limits, ? for parameters. Text columns are padded with spaces; compare with = (trailing blanks ignored) or TRIM(). Payroll tables are blocked unless the server owner enabled them.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

B3.4/5.0

Scored across 21 tools

Disambiguation4/5

Each tool targets a fairly distinct accounting artifact (trial balance, account ledger, journal, documents, stock, cash/bank, VAT, SAF-T checks), and descriptions explicitly clarify boundary cases like match=account vs match=prefix and balances vs register. Some genuine overlap remains between saga_journal and saga_account_ledger, and between saga_open_invoices and saga_partner_balances, which could cause occasional misselection.

Naming Consistency4/5

All names are snake_case with a consistent 'saga_' prefix, and most are resource-oriented nouns (saga_partner_balances, saga_cash_bank_register). There are minor deviations in verb usage: some resources use explicit verbs (saga_list_firms, saga_list_accounts, saga_describe_table, saga_query) while comparable ones do not (saga_partners, saga_documents).

Tool Count4/5

21 tools is on the heavy side, but the domain is a full accounting ERP and nearly every tool maps to a distinct report or artifact (trial balance, ledger, journal, invoices, stock, cash/bank, VAT, SAF-T, raw SQL access). It is slightly over-scoped rather than padded with redundant tools.

Completeness4/5

As a read-only reporting/inspection server it covers the main workflows well: firm discovery, chart of accounts, trial balance, ledgers, documents, partners, stock, cash/bank, VAT and SAF-T pre-checks, plus a generic SELECT escape hatch. Gaps are minor: no master lists for articles/warehouses (only date-based stock views), no payroll coverage beyond flagging, and no write operations by design.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues