Skip to main content
Glama

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:

  1. "mdn:" like "mdn:Web/JavaScript/Reference/Global_Objects/Array" → fetched directly from the MDN docs path;

  2. "ts:" like "ts:intro" or "ts:2/generics" → fetched directly as a TypeScript handbook page;

  3. 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

TableJSON Schema
NameRequiredDescriptionDefault
topicNo
identifierYes
max_tokensNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and does so well: it discloses the resolution algorithm, the tie-breaking precedence across mdn Reference/API/other/ts pages, the parent-beats-subpage rule, section pruning via topic, the truncation model (len(text)//4, cut at a line boundary, 'truncated': true), and the failure payload shape. This is far more than a restatement of the name and gives the agent a mental model of how the call actually behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in the first line, then details are ordered by parameter, with an ordered list for the resolution steps. The prose is information-dense with little filler, though the deep indentation and backtick-quoted parameter names make it slightly denser to scan than necessary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, no annotations, and 0% schema coverage, the definition still supplies the success shape (final markdown, optional topic section, 'truncated', 'note') and the failure shape ({"ok": False, "error", "suggestion"}). Nothing an agent needs to invoke and interpret this tool correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry all three parameters, and it does: identifier gets three concrete formats with examples, topic is defined as a heading filter with fallback behavior and a 'note' on available headings, and max_tokens gets both a default-sized meaning and the estimation formula. Every parameter is explained well beyond its bare name and type.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence gives a precise verb (Fetch), a specific resource (MDN Web Docs or TypeScript handbook page), and the return format (markdown). By describing the error fallback to js_search(), it implicitly positions itself as the retrieval counterpart to the search sibling, letting an agent distinguish the two without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The identifier resolution order effectively tells the agent when each input form applies (mdn:, ts:, or plain names), and the error section states what to do on failure (use js_search or a prefix). It stops short of an explicit 'use this when you already know the page; use js_search when you don't' rule, so the sibling routing is inferable rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools