js_docs
Fetch MDN Web Docs or TypeScript handbook pages as markdown using plain names or mdn:/ts: identifiers for quick reference lookup.
Instructions
Fetch an MDN Web Docs or TypeScript handbook page as markdown.
identifier resolution order:
"mdn:" like "mdn:Web/JavaScript/Reference/Global_Objects/Array" → fetched directly from the MDN docs path;
"ts:" like "ts:intro" or "ts:2/generics" → fetched directly as a TypeScript handbook page;
plain names like "Promise" → resolved through the search index: only the top-score candidates are considered; a single distinct path wins, ties prefer mdn Web/JavaScript/Reference pages over mdn Web/API pages over other mdn pages over typescript pages (within the winning tier a parent page beats its subpages); ambiguous or missing matches return an error dict suggesting js_search().
topic (a heading like "Methods") keeps only that heading section plus
title/description; if no such section exists the full content is returned
with a "note" listing the available headings. max_tokens truncates the
final markdown to roughly that many tokens (estimated as len(text)//4),
cut at a line boundary, and sets "truncated": true when applied.
On failure returns {"ok": False, "error", "suggestion"} — try js_search() to find the exact page, or use the mdn:/ts: prefix.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | No | ||
| identifier | Yes | ||
| max_tokens | No |