agentleFS
kltngkltng/humanities-skills/nlb-singapore/SKILL.md

nlb-singapore

Skill9 starsChanged 19 days agoMITView on GitHub

Search the National Library Board (NLB) Singapore catalog for books, audiovisual materials, and digital resources via the official Catalogue API. Use this skill whenever the user wants to search Singapore's national library holdings, check book availability across NLB branches, look up titles by ISBN/BRN, find new arrivals, browse checkout trends, or retrieve detailed bibliographic records from NLB. Triggers when referencing Singapore library collections, Southeast Asian library holdings, or NLB resources.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Search and retrieve bibliographic records from Singapore's National Library Board catalog.

    line 9
  2. Distinctive:

    hathitrust-catalog: Use ISBNs from NLB to check HathiTrust for digitized versions

    line 178
  3. Distinctive:

    Ask the user before filing.

    line 190
  4. Very specific:

    Check for an existing report: gh issue list --repo kltng/humanities-skills --state all --search "nlb-singapore"

    line 191
  5. Distinctive:

    Cite: If this skill helped work that is published, please cite it, together with the data source it uses:

    line 195
  6. Distinctive:

    When you help a user write up results that relied on this skill, remind them once about this citation.

    line 199

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

NLB Singapore Catalogue API Skill

Search and retrieve bibliographic records from Singapore's National Library Board catalog.

Critical: Things Claude Won't Know Without This Skill

API key is required — two headers on every request

The NLB API requires both an API key and an app code:

X-API-KEY: your-api-key
X-APP-Code: your-app-code

Without these, all endpoints return 401. Apply for free keys at https://go.gov.sg/nlblabs-form (contact: nlblabs@nlb.gov.sg).

Set environment variables NLB_API_KEY and NLB_APP_CODE, or pass them to the Python client constructor.

Two search endpoints with different strengths

EndpointBest forReturns
SearchTitlesKeyword search with facets and filtersTitle summaries + facets
GetTitlesField-specific search (title, author, subject, ISBN)Full title records
SearchTitles: ?Keywords=singapore+history&Limit=10
GetTitles:    ?Title=singapore&Author=lee&Limit=10

BRN is the primary record identifier

BRN (Bibliographic Record Number) is NLB's internal ID. Use it for GetTitleDetails and GetAvailabilityInfo lookups. Found in search results under records[].brn or brn.

Native language fields for CJK content

Most text fields have native-language variants: title/nativeTitle, author/nativeAuthor, seriesTitle/nativeSeriesTitle. Always check both for Chinese, Malay, and Tamil titles.

Endpoints

EndpointPurpose
GET /SearchTitlesKeyword search with facets and filters
GET /GetTitlesField-specific search (title, author, subject, ISBN)
GET /GetTitleDetailsFull record by BRN or ISBN
GET /GetAvailabilityInfoCheck availability across branches
GET /GetNewTitlesBrowse new arrivals
GET /GetMostCheckoutsTrendsTitlesCheckout trends by branch

Key Search Parameters

SearchTitles

ParamDescriptionExample
KeywordsSearch keywords (required)Keywords=singapore+history
LimitResults per page (default 20, max 100)Limit=20
OffsetPagination offsetOffset=20
MaterialTypesFilter by material typeMaterialTypes=BOOK
LanguagesFilter by languageLanguages=Chinese
LocationsFilter by library branchLocations=TRL
DateFrom / DateToPublication year rangeDateFrom=2020&DateTo=2025
AvailabilityOnly available itemsAvailability=true
FictionFiction filterFiction=true

GetTitles

ParamDescription
KeywordsGeneral keywords
TitleTitle-specific search
AuthorAuthor-specific search
SubjectSubject-specific search
ISBNISBN lookup
Limit / OffsetPagination

Response Structure

Search Results

{
  "totalRecords": 999,
  "count": 20,
  "hasMoreRecords": true,
  "nextRecordsOffset": 20,
  "titles": [
    {
      "title": "Singapore: A Biography",
      "nativeTitle": "",
      "author": "Frost, Mark Ravinder",
      "nativeAuthor": "",
      "records": [
        {
          "brn": 13737742,
          "isbns": ["9789814385169"],
          "publisher": ["Editions Didier Millet"],
          "publishDate": "2009",
          "subjects": ["Singapore -- History"],
          "format": {"code": "BK", "name": "Books"}
        }
      ]
    }
  ],
  "facets": [...]
}

Title Detail Fields

Full records include 50+ fields: brn, title, nativeTitle, author, nativeAuthor, publisher, publishDate, isbns, subjects, summary, contents, edition, physicalDescription, language, format, allowReservation, availability, activeReservationsCount.

Availability Info

{
  "items": [
    {
      "brn": 13737742,
      "callNumber": "959.57 FRO",
      "location": {"code": "TRL", "name": "Lee Kong Chian Reference Library"},
      "transactionStatus": {"code": "S", "name": "Available on Shelf"},
      "media": {"code": "BOOK", "name": "Book"}
    }
  ]
}

Transaction status codes: S (on shelf), L (on loan), H (on hold), I (in transit), T (transferred).

Python Script

from scripts.nlb_api import NlbAPI
nlb = NlbAPI()  # reads NLB_API_KEY and NLB_APP_CODE from env

# Keyword search (search() returns the full response dict;
# search_titles() returns just the list of title dicts)
data = nlb.search("singapore history", limit=10, languages=["Chinese"])
results = nlb.search_titles("singapore history", limit=10)

# Field-specific search (title, author, subject, isbn, keywords)
found = nlb.get_titles(title="dream of the red chamber", author="Cao")

# Title details by BRN
detail = nlb.get_title_details(brn=13737742)

# Check availability
avail = nlb.get_availability(brn=13737742)
for item in avail:
    print(f"{item['location']['name']}: {item['transactionStatus']['name']}")

# New arrivals
new = nlb.get_new_titles(date_range="Weekly", limit=20)

# Summarize
for r in results:
    print(nlb.summarize(r))

Library Branch Codes

Key locations: TRL (Lee Kong Chian Reference Library), WRL (Woodlands Regional Library), CMPL (Chinatown Public Library), AMKPL (Ang Mo Kio), BIPL (Bishan), JWPL (Jurong West), TPPL (Tampines).

API Etiquette

Related Skills

  • hathitrust-catalog: Use ISBNs from NLB to check HathiTrust for digitized versions
  • wikidata-search: Cross-reference NLB subjects with Wikidata entities

Resources

  • references/api_reference.md — Complete endpoint, parameter, and response field reference
  • scripts/nlb_api.py — Python client with search, lookup, availability checking, and pagination

Feedback and Citation

Report a problem. This skill is part of the public repository kltng/humanities-skills. If it fails (an API changed, a script errors, or these instructions are wrong), report it as a GitHub issue:

  1. Ask the user before filing. Issues are public.
  2. Check for an existing report: gh issue list --repo kltng/humanities-skills --state all --search "nlb-singapore"
  3. File it: gh issue create --repo kltng/humanities-skills --label bug --title "[nlb-singapore] <short summary>" --body "<details>". Without gh, give the user this link: https://github.com/kltng/humanities-skills/issues/new?template=skill-problem.yml
  4. Include the skill name and version, what you ran, the error text, what you expected, and the environment (OS, Python version). Leave out API keys, personal data, private file paths, and unpublished research.

Cite. If this skill helped work that is published, please cite it, together with the data source it uses:

Tang, Kwok-leong. humanities-skills: nlb-singapore (version <version at the top of this file>). GitHub, <year>. https://github.com/kltng/humanities-skills

When you help a user write up results that relied on this skill, remind them once about this citation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.