Skip to main content
Glama

ledger-agent

Grounded full-stack agent for FASTag / wallet / ops support demos.

Built for Full Stack + Agentic AI portfolios: tool-calling, RAG, MCP, evals, and a real HTTP UI — with fake SQLite data only (safe to publish).

The model reads. Tools decide. Docs never invent money.

Architecture notes · MIT License

What you can demo in an interview

Question

What fires

“Was PhonePe Message 6821438796 credited?”

SQL find_by_reference_id

“Check UTR 826840318056”

SQL find_by_utr

“Why can’t I issue tag 608268-007-0117503?”

explain_tag → TAG_PENDING_ACK

“Why is ORDER0000000001 stuck / less mapped?”

explain_order → ORDER_PARTIAL_DISPATCH_STUCK

“Any errors for that order?”

search_logs (fake Loki)

“Gallery or RC only?”

RAG search_docs

Related MCP server: mcp-production-mastery

Stack

  • Node 22+ Express API + static UI

  • node:sqlite ledger / orders / logs (no Visual Studio native build)

  • Deterministic planner → tool registry → human answer + tool trace

  • RAG over docs/*.md (keyword retriever; swap for embeddings later)

  • MCP (@modelcontextprotocol/sdk) — same tools over stdio for Cursor

  • Optional Gemini screenshot OCR (GEMINI_API_KEY)

Quick start

git clone https://github.com/Vikas62502/ledger-agent.git
cd ledger-agent
cp .env.example .env   # optional GEMINI_API_KEY
npm install
npm run seed
npm run eval           # expect 9/9
npm run dev

Open http://localhost:4050.

MCP in Cursor

Repo includes .cursor/mcp.json. Or:

npm run mcp
{
  "mcpServers": {
    "ledger-agent": {
      "command": "node",
      "args": ["--experimental-sqlite", "src/mcp/server.js"],
      "cwd": "/absolute/path/to/ledger-agent"
    }
  }
}

API

Method

Path

Body

POST

/api/ask

{ "text": "..." }

POST

/api/ask-screenshot

multipart text + image

GET

/api/tools

—

GET

/api/health

—

Response includes answer, plan, toolResults (show this in interviews).

Project layout

docs/                 RAG runbooks
evals/                Deterministic regression cases
public/               Minimal UI
src/agent/            Classify + optional Gemini OCR + agent loop
src/db/               Schema + seed (fake data)
src/mcp/              MCP stdio server
src/rag/              Local docs index
src/tools/            Ledger + ops + docs + registry

Design principles (say this in interviews)

  1. Grounding — amounts, ownership, order counters come from SQL tools

  2. Separation — RAG = process; logs = runtime; never conflate with money

  3. One registry — HTTP agent and MCP call the same invokeTool

  4. Evals first — CI-friendly cases without a live LLM

  5. Safe publish — demo DB only; no prod secrets

Author

Vikas Yadav — Full Stack / Agentic AI

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients such as Cursor and Claude Desktop to query a GRC platform over stdio or HTTP, with read-only access by default and opt-in create, update, and delete tools subject to platform authorization.
      3
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to query product footprints, inspect transport activity data, and submit events from iLEAP-conformant endpoints through natural language, using MCP tools over Streamable-HTTP or stdio.
      1
      MIT