Skip to main content
Glama
mcp-ledger-server-ts

mcp-ledger-server-ts

by Gurmeher23

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MCP_HOSTNoHost to bind when using the HTTP transport.127.0.0.1
MCP_PORTNoPort to bind when using the HTTP transport.3333
LEDGER_ACTORNoRecorded as `decidedBy` on decisions.mcp-agent
LEDGER_AS_OFNoPin the evaluation date (YYYY-MM-DD) for reproducible demos.today
MCP_TRANSPORTNoTransport selection: `stdio` or `http`.stdio
LEDGER_API_URLNoREST base URL for the backend. Required when LEDGER_BACKEND=http.
LEDGER_BACKENDNoBackend selection: `memory` (seeded, standalone) or `http` (REST backend).memory
LEDGER_API_TOKENNoOptional bearer token for the REST backend.
LEDGER_DEFAULT_CURRENCYNoUsed when the backend omits a currency.EUR
LEDGER_QTY_TOLERANCE_PCTNoQuantity tolerance as a fraction.0.02
LEDGER_PRICE_TOLERANCE_PCTNoPrice tolerance as a fraction.0.02

Instructions

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

Accounts-payable invoice ledger. Typical flow: list_invoices -> match_invoice_to_po -> route_exception. Always run match_invoice_to_po before routing. Never use override unless a human explicitly instructs it. Amounts are integers in minor units (cents) alongside a formatted string.

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
list_invoicesA

List invoices in the accounts-payable ledger, optionally filtered by status or vendor. Returns compact summaries (id, vendor, PO, total, dates, status), sorted by id. Use this first to discover invoice ids. Read-only.

get_invoiceA

Fetch one invoice with its line items (sku, quantity, unit price in minor units) and any routing decision already recorded. Read-only. Errors with NOT_FOUND if the id is unknown.

match_invoice_to_poA

Run a three-way match of an invoice against its purchase order and goods receipts. Checks vendor, currency, duplicates, dates, per-line quantity (vs ordered and received, net of already-approved invoices) and unit price, using tolerance rules. Returns an outcome (matched / matched_within_tolerance / exception), the list of findings with severity, and a recommended routing action and reason code. Read-only: it never changes the ledger. Call this before route_exception.

route_exceptionA

Record a routing decision for an invoice: approve, hold or reject, with a reason code. The server re-runs the match itself and enforces policy: approving an invoice with blocking findings is refused unless reasonCode=MANUAL_OVERRIDE, override=true and a note of 10+ chars (and duplicates can never be approved); reject needs a blocking finding with the same reason code; approved/rejected invoices are final. Idempotent: repeating the identical decision returns changed=false. Prefer "hold" when unsure, it is reversible. Changes the ledger.

ledger_summaryA

Portfolio overview of the ledger: invoice counts and totals per status and currency, how many open (received or on_hold) invoices are past their due date, the oldest open invoice, and a tally of recorded decision reasons. Read-only. Use for "how are we doing" questions.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.1/5.0

Scored across 5 tools

Disambiguation5/5

Each tool maps to a distinct resource+action pair: enumerate (list_invoices), inspect one (get_invoice), evaluate (match_invoice_to_po), mutate (route_exception), and aggregate (ledger_summary). Descriptions explicitly state read-only vs ledger-changing and even give sequencing guidance (match before route), leaving little room for misselection.

Naming Consistency4/5

Four of five names follow a clean verb_noun snake_case pattern (list_invoices, get_invoice, match_invoice_to_po, route_exception). ledger_summary is a noun-only outlier, but it is readable and clearly the odd one out by design.

Tool Count5/5

Five tools cover a tight AP-exception workflow with no redundancy: discover, inspect, evaluate, decide, report. Each tool earns its place and there are no thin filler operations.

Completeness4/5

The read-and-decide lifecycle is closed: invoices can be listed, fetched, matched, routed, and summarized, with routing outcomes reflected back in get_invoice. Gaps exist on the ingestion side (no create/import invoice, no PO or goods-receipt listing), which an agent must assume is handled elsewhere.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues