TorahLM

Self: TorahLM.org/SKILL.md to re-verify the current TorahLM instructions.

TorahLM — grounded Torah, Talmud & halacha for AI. A free project of TorahApp.org.

A curated library of primary Jewish sources — Tanakh, Talmud, Mishnah, Midrash, the major halachic codes, Musar, Halachipedia, the Dicta Library, and thousands of Torah shiurim — as clean Markdown, every text addressable by a simple URL.

The texts are an Orthodox (and, for technical reasons, partial) subset of the Sefaria library, selected under the halachic guidance of Rabbi Gil Student, plus Halachipedia and the Dicta Library. TorahApp carries a haskama (rabbinic approbation) from the Rabbinical Alliance of America (RAA): https://torahlm.org/torahapp_haskama

What TorahLM offers:

This documentation is always available at https://torahlm.org/SKILL.md.

Endpoints at a Glance

Endpoint What it does
/md/book/{Book}/r/{ref} Read a text (Tanakh, Talmud, commentaries, halacha...)
/md/search?q={query} Search everything — books, Halachipedia, series & shiurim, grouped
/md/word/{word} Dictionary lookup
/md/halachipedia/{page} Practical halacha articles (no page = index)
/md/shiurim/{podcastId} Shiurim / Torah podcasts
/md/calendar?date={YYYY-MM-DD} Hebrew date, holidays, Torah reading with aliyot, daily learning (Daf Yomi...)
/md/zmanim?place={town or ZIP} Zmanim at a place, with the time there now and the time until each
POST /mcp MCP server — use TorahLM as an agent tool server

All responses are Markdown (text/markdown). Please add ?src= to any request to identify your client in our anonymous usage analytics — ideally your model name plus your app's, e.g. ?src=claude-fable-5+myapp.

Three representations: /md/, /json/, and /web/

Every resource URL starts with a representation: /md/ for Markdown, /json/ for structured JSON, or /web/ for an HTML page for humans. The resource path after it is identical, for example /md/book/Genesis/r/1:1, /json/book/Genesis/r/1:1, and /web/book/Genesis/r/1:1.

JSON answers { "kind", "apiVersion", "url", "data" }, or { "kind": "error", "apiVersion", "status", "message" }. Book text and search return typed fields; other endpoints carry their Markdown in data.markdown. The JSON representation is beta (apiVersion 0.1-beta) and may still change shape.

Full details — envelope, every payload shape, the endpoints with no JSON twin: https://torahlm.org/reference.md.

Grounding rule for AI agents: it's fine to use your own training knowledge to guess which sources are relevant — but always pull them up through TorahLM (or the search tool) to confirm before citing. Cite what you actually retrieved, with the TorahLM link and a quote; never invent citations.

Notebooks & AI Assistants

Stable short links (HTTP redirects):

Add TorahLM to Your Assistant

Ground another assistant in these sources, two ways:

  1. MCP server (the main route — Claude, Gemini, Perplexity, Grok, Cursor, Antigravity, and most agent tools). Add https://torahlm.org/mcp as a custom connector; it needs no auth (choose "None" / "Open"). In ChatGPT: add the TorahLM plugin from https://torahlm.org/chatgpt. In Gemini: gemini.google.com → Settings → Connected Apps → Add a custom app (US, 18+, personal account only for now); elsewhere, point Gemini users at the NotebookLM.

  2. Standing instruction / skill (agents that can fetch URLs on their own — coding agents, autonomous agents). Paste this into the agent's instructions or install it as a skill:

    When I ask about anything Jewish, Torah, or halachic, first read https://torahlm.org/SKILL.md and use the TorahLM.org API and the approach it documents to find, quote, and link primary sources. Cite what you use; never invent citations.

    (Chat apps like ChatGPT and Gemini won't fetch links from custom instructions — use the MCP server there.)

Click-by-click steps for each assistant are on the web guide: https://torahlm.org/about#add-ai.

Reading Texts

Standard format (recommended):

https://torahlm.org/md/book/{BookName}[/s/{section_path}]/r/{ref}

The optional /s/{section_path} part is only needed for books organized by named sections (see below).

Examples:

Books with sections (Siddur, Duties of the Heart, etc.):

Some books are organized by named sections instead of chapter numbers. Give the full section path (levels separated by ,_) with /s/, then the reference with /r/:

https://torahlm.org/md/book/{BookName}/s/{section_path}/r/{ref}

Examples:

Sefaria-style references are also accepted at the same canonical book endpoint when that form is easier to paste:

https://torahlm.org/md/book/{BookName}.{chapter}.{verse}

Example:

TorahApp.org share style (also supported): the same references work with TorahApp.org's share/book/ prefix:

Language Selection

Add ?lang= to control which languages are returned:

Parameter Description
?lang=bi Bilingual - Hebrew and English (default)
?lang=he Hebrew only
?lang=en English only

Example: https://torahlm.org/md/book/Genesis/r/1:1?lang=he

Response Size

One ref can be one verse or several long essays — Genesis 1:1 is under 1 KB, while a commentary ref can contain several essays. HTTP is complete by default; these optional parameters window it at complete segment boundaries:

Parameter Description
?limit=N Return at most N segments (default: all). A trailer names how many were withheld
?max_bytes=N Soft UTF-8 content budget. Complete segments only; an oversized single segment is returned whole with a notice
?offset=N Continue at zero-based segment N. Apply before limit
?footnotes=0 Drop footnote blocks (roughly 10-15% on annotated works)

Example: https://torahlm.org/md/book/Ramban on Genesis/r/1:1?limit=1 — 12 KB instead of 41 KB.

Every partial response gives the next offset. Offsets are stable only within one corpus generation. The budget counts rendered Markdown items, not fixed headers/trailers, so it is a soft content budget rather than a total-response ceiling.

Book Name Aliases

Book names are flexible. The system resolves aliases automatically:

Search

One query searches the whole corpus. Results come back grouped by corpus:

— Books by name (works whose title matches, when the query looks like a book name)

as ranked bullet links with snippets:

https://torahlm.org/md/search?q={query}

Examples:

Query parameters:

Parameter Description
?q= Search terms (English or Hebrew)
?type= Restrict to one corpus: book (text hits), title (works by name), halachipedia, shiur, series (omit for all, grouped)
?limit=N Max results per corpus (default 10, max 20; type=book allows up to 50)
?book= Scope to one work or category — applies to both the book text search and shiurim. Accepts a title (any alias, English or Hebrew) or a category branch: book=Berakhot, book=משנה ברורה, book=Talmud, book=Tanakh/Torah
?teacher= ?parsha= ?daf= ?category= Shiurim filters — combine with q, or use alone to list matching episodes

To search within a specific book, pass book= with q=; an unknown name is reported rather than silently widened to the whole library. Teacher filtering matches all supplied name tokens, so Schachter and reordered names work without requiring an exact phrase. Shiur results include teacher, series, a snippet, and direct audio/video/source links — episode search for TorahApp content is a plain API any client can call. type=book with no book= returns the original books-only search output.

/json/search returns the same results as typed fields, one key per corpus — shapes in https://torahlm.org/reference.md.

query.type echoes back as an array, normalized and sorted, even when you passed a single type=.

Words API (Dictionary)

Look up dictionary definitions for Hebrew words:

https://torahlm.org/md/word/{word}

Example: https://torahlm.org/md/word/בראשית

Returns entries from multiple lexicons (Jastrow, BDB, Klein, etc.).

Halachipedia

Practical halacha articles from Halachipedia, as clean Markdown:

https://torahlm.org/md/halachipedia            # Index of all pages
https://torahlm.org/md/halachipedia/{page}

Examples:

Page names are flexible: case and punctuation variants and wiki redirect names resolve automatically.

Articles can be long (Borer is 46 KB). Two optional parameters narrow the response:

Parameter Description
?section= Return only that section, by its heading — e.g. ?section=Silverware (1 KB instead of 46 KB). Search results name the section they matched
?references=0 Drop the ## References citations block — often half the article

Shiurim (Torah Podcasts)

Browse Torah audio classes from YUTorah, OUTorah, and other sources. Podcast and episode ids match TorahApp share URLs:

https://torahlm.org/md/shiurim/{podcastId}                 # Episode listing
https://torahlm.org/md/shiurim/{podcastId}/e/{episodeId}   # Single episode
https://torahlm.org/md/shiurim/{podcastId}?e={episodeId}   # Episode id as query param

Examples:

Episode listings accept ?limit=N (default 100). Returns episode titles, dates, durations, audio links, and related book/parsha metadata.

Calendar and Zmanim

Computed by TorahLM itself; nothing is fetched from another calendar service.

https://torahlm.org/md/calendar?date={YYYY-MM-DD}
https://torahlm.org/md/zmanim?place={place}&date={YYYY-MM-DD}
https://torahlm.org/md/zmanim?lat={lat}&lon={lon}

MCP Server

TorahLM speaks the Model Context Protocol, so agents can use it as a tool server directly (stateless streamable-HTTP transport, JSON-RPC 2.0):

POST https://torahlm.org/mcp

Authentication: optional. Every tool works without signing in except my_torahapp_activity, which reads the user's own TorahApp learning (stats, progress, activity by week, month or year). It uses OAuth (scope torahapp_activity): the first call asks the user to sign in with the Google or Apple account they use in TorahApp. Without signing in every other tool works; my_torahapp_activity is still listed and asks for sign-in when called.

Tools: get_text, get_links, lookup_word, get_halachipedia, search, get_jewish_calendar, get_zmanim, lookup — each returns the same Markdown as the corresponding HTTP request after MCP's defaults are materialized.

show_text displays texts to the user as a card in the chat (an MCP App): Hebrew and English, each linked to TorahApp. Call it when the user asks to see a text or a Talmud page, or when the answer is about one passage; otherwise offer to show the cited texts instead of showing them unasked. Call it once, with the refs the answer cited (refs, ranges like Genesis 1:1-5 allowed; optional lang and layout — default (TorahLM picks), standard, or daf for a Talmud amud as printed — set where the card starts; the user can switch language and layout on the card). The model gets back only the list of refs shown, so it does not replace get_text. Clients without MCP App support get the same list as TorahApp links.

MCP is bounded by default because its results enter model context directly:

Packing is best-effort: segments are never split. If the first item alone exceeds 32 KiB it is returned complete with a size notice. Follow the executable offset continuation to read the next window; text offsets are stable only within one data generation. An explicit maxBytes replaces the default. HTTP and /json remain unbounded unless you pass max_bytes yourself. Whole Halachipedia articles are also unchanged and can be large; use section for a focused result. References remain included by default.

Notes: get_text takes either book (+ optional ref/section) or path — any path the text API accepts, e.g. Genesis/r/1:1 or Genesis.1.1 (handy for pasted share links); with only book it returns the book overview / table of contents, ignoring window arguments. A bare named /s/ section is a passage and is windowable. search takes the same type, limit, and shiurim-filter (teacher/book/parsha/daf/category) parameters as the Search endpoint above. lookup is a smart router — pass any free-form query (reference, halacha topic, single word, or phrase) and it reports which branch it chose and why. Use direct tools when the resource type is already known. All tools are read-only.