For developers
LangChain tools for Singapore money data
Eight free LangChain tools that give an agent Singapore’s rates, prices and money rules, each answer dated and traced to its official source. No API key.
LangChain integration · free · no key
8 tools
for 38 Singapore datasets and 5 calculators, from 12 official publishers
Every answer carries its date, its source, when we last read that source and whether the read is late.
In the toolkit
NumbersSGListDatasetsWhich dataset answers a question, and its idNumbersSGGetValueOne figure to quote, with its date, source and linkNumbersSGGetDatasetRows for a trend or comparison, with what each field meansNumbersSGStampDutyBSD and ABSD on a Singapore property, tier by tierNumbersSGTakeHomePayWhat reaches the bank after CPF and tax, or the pay for a take-home figureNumbersSGIncomeTaxResident income tax with every relief, band by bandNumbersSGCPFContributionCPF on a month’s pay, with the split between accountsNumbersSGSSBReturnsEvery interest payment on a Savings Bond, or a switch compared
API keys needed
0
No sign-up: the same free service as our MCP server
Latest release
v0.1.1
On PyPI, 4 Dec 2026
LangChain’s standard tests
Passing
Unit and integration, sync and async, every tool: last run 4 Dec
LangChain tools for Singapore money data in short
Our API’s dataset list, PyPI and GitHub, read as this page loads · checked
The langchain-numbers-sg package gives a LangChain agent eight free tools for Singapore’s money numbers, covering 38 datasets such as SORA, T-bills, COE and CPF from 12 official publishers, plus five tax, CPF and bond calculators, with no API key.
8Tools, one install
Three read the 38 datasets and five work out stamp duty, take-home pay, income tax, CPF and Savings Bond returns, using the same engines as the calculators on this site. See all eight
12Official publishers
Figures come from MAS, LTA, CPF Board, IRAS and 8 other official publishers, and every answer gives the date of its row and when we last read the source, so a model can say how current a number is. What an answer contains
0Keys or sign-ups
Install it and call it: there is no account, key or paid tier. Our own tests run with no key configured, so they prove a stranger’s first call works. Install
PassLangChain’s standard tests
All eight tools pass LangChain’s own unit and integration tests, sync and async, run on every change and every week; the last run was on 4 Dec 2026. How it’s tested
Go deeper: Your first call · LangChain, MCP or REST? · Questions
Install
One package, no key and nothing to sign up for. It needs Python 3.10 or later and langchain-core, which it installs for you.
pip install -U langchain-numbers-sgv0.1.1 on PyPI Tests passing, 4 Dec read from PyPI and GitHub 4 hours ago
Your first call, without a model
Every tool is an ordinary LangChain tool, so you can call it directly before you hand it to an agent. This asks for the latest COE Category A premium:
from langchain_numbers_sg import NumbersSGGetValue
print(NumbersSGGetValue().invoke({
"id": "coe-results",
"field": "quota_premium_sgd",
"where": {"category": "A"},
}))What it prints right now. This answer was produced by the same service when this page was built, not typed in, so the figure and the time we last read LTA’s data are real.
COE bidding results, every round since 2010: quota_premium_sgd = S$130,100, as of 2026-11.
Meaning: The quota premium: what every successful bidder in the category pays.
Row: {"month":"2026-11","round":2,"closing_date":"2026-11-18","category":"A","quota_premium_sgd":130100,"quota":1193,"successful_bids":1130,"bids_received":1464,"premium_in_latest_cpi_month_sgd":130100,"pqp_for_next_month_sgd":132668}
Source last read: 2026-12-04T08:50:00+08:00 (Singapore time).
Published by: Land Transport Authority (LTA), via data.gov.sg; Department of Statistics (SingStat)
Link: https://numbers.sg/cars/coe-results/
Credit: Source: Land Transport Authority, via data.gov.sg and Department of Statistics, compiled by Numbers.sg (numbers.sg/cars/coe-results/), CC BY 4.0
Three things in that answer matter more than the number itself. The date of the row (“as of”), so the model says which bidding round it means. When we last read the source, so it can tell a current figure from an old one. And the page to link and the credit line, so a reader can check it.
Add it to an agent
Give an agent the whole toolkit and it picks the right tool for each question. This uses LangChain 1.0’s create_agent; any chat model that supports tool calling works.
from langchain.agents import create_agent
from langchain_numbers_sg import NumbersSGToolkit
agent = create_agent(
"anthropic:claude-sonnet-5-5",
tools=NumbersSGToolkit().get_tools(),
system_prompt="Answer Singapore money questions with the tools. Give each figure's date and source, and link the page.",
)
result = agent.invoke({"messages": [{"role": "user", "content":
"I earn S$6,000 a month and I'm 30. What reaches my bank, and what would a year of savings earn at the latest 6-month T-bill yield?"}]})
print(result["messages"][-1].content)To answer that, the agent calls NumbersSGTakeHomePay for the salary and NumbersSGGetValue on tbill-auctions for the yield. Our tests build this exact agent against the newest LangChain every week, so the example keeps working.
Only need some of the tools? Pass the ones you want, for example tools=[NumbersSGGetValue(), NumbersSGStampDuty()]. Fewer tools means fewer wrong picks for small models.
Using LangGraph? The tools work in a ToolNode like any other LangChain tool, and each has an async version, so they won’t block an async graph.
The eight tools
Three tools read the datasets and five work out sums. The calculators use the same engines as the calculators on this site, and each answer lists the rules it used, when they were last checked and the official pages they come from.
| Class | Answers, and its inputs (* required) |
|---|---|
NumbersSGListDatasets | Which dataset answers a question, and its idInputs: query |
NumbersSGGetValue | One figure to quote, with its date, source and linkInputs: id* field* date where |
NumbersSGGetDataset | Rows for a trend or comparison, with what each field meansInputs: id* view start end fields limit |
NumbersSGStampDuty | BSD and ABSD on a Singapore property, tier by tierInputs: price* value buyers married date kind hdb senior |
NumbersSGTakeHomePay | What reaches the bank after CPF and tax, or the pay for a take-home figureInputs: pay* age* who direction aws_months bonus fund stay |
NumbersSGIncomeTax | Resident income tax with every relief, band by bandInputs: pay bonus employment_income age ya res sex cpf trade rent other donations spouse kids working_mother grandparent parents siblings_dis ns ns_wife ns_parents disabled life_premiums life_insured srs topup_self topup_family ptr |
NumbersSGCPFContribution | CPF on a month’s pay, with the split between accountsInputs: pay* bonus age born who month |
NumbersSGSSBReturns | Every interest payment on a Savings Bond, or a switch comparedInputs: bond amount redeem switch_to |
Inputs are read from the live service each time this page is built. The package’s weekly test fails if a calculator’s inputs change without a new release, so this table and the package can’t drift apart. NumbersSGToolkit().get_tools() returns all eight.
What every answer tells the model
A model asked for the T-bill yield or the COE premium answers from training data that is months old, for figures that change every two weeks. These tools are built so the model has no reason to guess:
- The figure with its unit and meaning: “S$130,100”, not “130100”, and what a quota premium is.
- The date of the row: the bidding round, auction or month the figure belongs to.
- When we last read the source, in Singapore time, and LATE if a scheduled read didn’t happen, so the model can warn that a newer figure may exist. Our update schedule says when each source is read.
- The publisher: MAS, LTA, CPF Board, IRAS, SingStat or whoever published it, with the Numbers.sg page that charts and explains the series.
- A credit line ready to repeat, because the data is CC BY 4.0.
Tool descriptions are prompts too. Ours tell the model to give the date and source with each figure and not to replace it with one from memory.
Questions it handles well
- “What did COE Category B close at in the last round, and how does that compare with a year ago?” (get_value, then get_dataset with
start) - “What’s 3-month compounded SORA today, and what was it in January?” (get_value with
date) - “How much stamp duty would a PR couple who own one home pay on a S$1.8 million condo?” (stamp duty,
buyers="spr:1,spr:1",married=True) - “I want S$5,000 a month in the bank. What salary do I need at 28?” (take-home pay,
direction="net") - “How much tax would I save by putting S$15,300 in my SRS this year?” (income tax, with and without
srs) - “Should I switch my old Savings Bond to the newest one?” (SSB returns,
switch_to) - “How many yen does S$1,000 buy, and is that better than last month?” (get_dataset on
fx-sgd-jpy)
It isn’t built for share prices, bank promotions or anything that needs your own account data. Our full list of datasets shows exactly what it covers.
How it’s tested
- LangChain’s own standard tests. Every tool passes
langchain-tests, the unit and integration suites LangChain publishes for integrations, in both sync and async modes, on Python 3.10, 3.12 and 3.13. - With no key, against the live service. No secret is configured, so a passing run proves that a stranger’s first call works.
- Every week, not only on changes. A scheduled run catches a new LangChain release or a change on our side before a user does. A separate check runs against the newest
langchain-core. - Inputs can’t drift. A test compares each calculator’s inputs with the live service and fails if they differ.
- The sums are checked against official examples. Each calculator answer says how many of CPF Board’s or IRAS’s own worked examples it matches.
v0.1.1 on PyPI Tests passing, 4 Dec read from PyPI and GitHub 4 hours ago
Limits and errors
- Rate limit: 60 requests per 10 seconds per address, shared with the REST API. An agent loop will rarely come close.
- Errors come back as sentences, not exceptions, so the model can recover. Ask for a dataset that doesn’t exist and the tool says so and points to
NumbersSGListDatasets. A dropped connection is retried once before the model hears about it. - Rows:
NumbersSGGetDatasetreturns at most 500 rows, the newest, with the address of the full series as JSON and CSV. - Not advice: the answers are general information from official sources. The tools don’t know a user’s own circumstances, and the calculators say which reliefs or rules they leave out.
LangChain, MCP or the REST API?
| If you are building | Use | Why |
|---|---|---|
| A LangChain or LangGraph agent in Python | This package | Tested LangChain tools, answers formatted for a model |
| Claude, Cursor or another MCP client | The MCP server | Same eight tools, nothing to install |
| An app, spreadsheet or dashboard | The REST API | JSON and CSV, full history, OpenAPI file |
| A one-off analysis | The CSV downloads | Every series as a file, with a citation |
All four read the same data, so they always agree. The package calls our MCP server (https://numbers.sg/api/mcp, listed in the official MCP Registry as io.github.numbers-sg/data), which is why its tools and the server’s can’t disagree.
Credit and licence
The package is MIT-licensed. Most of the data is CC BY 4.0: free to use and republish, even commercially, with the credit line each answer gives. A few series are marked facts-only: quote the figures freely, but check the publisher’s terms before republishing a whole series. NumbersSGListDatasets says which is which.
Who maintains it
The package is written and maintained by Jeremiah Say, who runs Numbers.sg (ORCID). Report a bug or ask for a dataset in the GitHub issues, or use our contact page. If a figure is wrong, the corrections page shows how we fix and log it.
Changes: 4 Dec 2026: version 0.1.0, eight tools; the same day, 0.1.1 (package details only: the licence shows as MIT on PyPI).
Questions
Is langchain-numbers-sg free?
Yes. There is no key, account or paid tier, and the package is MIT-licensed. The only limit is 60 requests per 10 seconds per address.
Does it work with models other than Claude?
Yes. The tools are standard LangChain tools, so any chat model that supports tool calling can use them, including OpenAI, Gemini, Mistral and local models through Ollama.
How current are the numbers?
As current as the publisher. SORA and exchange rates are read every business day, and T-bills, COE and Savings Bonds after each auction or round. Every answer gives the time we last read the source and marks it LATE if a read was missed.
Can I use it in a commercial product?
Yes. The code is MIT and most data is CC BY 4.0, which allows commercial use with credit. Series marked facts-only can be quoted but not republished whole without checking the publisher’s terms.
Is this financial advice?
No. The tools return official figures and work out sums from published rules. They don’t know anyone’s full circumstances, so an agent should present the answers as information, not as a recommendation.
Can I use it from JavaScript?
Not as a package yet. From LangChain.js, connect to our MCP server with LangChain’s MCP adapters, which gives you the same eight tools, or call the REST API directly.