mockzilla_docs_topics
Lists available documentation topics to help you identify relevant guides before searching or reading specific topics.
Instructions
List the available mockzilla doc topics (e.g. 'usage/portable', 'middleware', 'config/service'). Call this once at the start of a session involving non-trivial mockzilla usage to know what knowledge is available; then call mockzilla_docs_search with a query or mockzilla_docs_read for a specific topic.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- lib/tools.js:248-261 (registration)Registration of the 'mockzilla_docs_topics' tool in the LOCAL_TOOLS registry with description, empty inputSchema, and a handler that calls topicsList().
mockzilla_docs_topics: { description: "List the available mockzilla doc topics (e.g. 'usage/portable', " + "'middleware', 'config/service'). Call this once at the start " + "of a session involving non-trivial mockzilla usage to know what " + "knowledge is available; then call `mockzilla_docs_search` with " + "a query or `mockzilla_docs_read` for a specific topic.", inputSchema: { type: "object", properties: {}, additionalProperties: false, }, handler: async () => await topicsList(), }, - lib/tools.js:6-6 (registration)Import of topicsList from ./docs.js.
import { readTopic, searchDocs, topicsList } from "./docs.js"; - lib/docs.js:26-44 (handler)Handler function topicsList() — fetches the list of available doc topics either from local disk (topicsListLocal) or from GitHub API by filtering .md files under docs/ in the mockzilla/mockzilla repo tree.
export async function topicsList() { if (LOCAL_DIR) return await topicsListLocal(); if (topicsCache && Date.now() - topicsAt < TTL_MS) { return { topics: topicsCache, source: "github (cached)" }; } const res = await fetch(TREE_URL); if (!res.ok) { throw new Error(`GitHub tree fetch failed: ${res.status} ${res.statusText}`); } const body = await res.json(); const topics = (body.tree || []) .filter((e) => e.type === "blob" && e.path.startsWith("docs/") && e.path.endsWith(".md")) .map((e) => topicFromPath(e.path)) .sort(); topicsCache = topics; topicsAt = Date.now(); return { topics, source: `github://${REPO}@${BRANCH}` }; } - lib/docs.js:93-100 (helper)topicsListLocal() — walks a local MOCKZILLA_DOCS_DIR to list .md files as fallback when LOCAL_DIR is set.
async function topicsListLocal() { const files = []; await walk(LOCAL_DIR, "", files); const topics = files .filter((f) => f.endsWith(".md")) .map((f) => f.replace(/\.md$/, "")) .sort(); return { topics, source: `local://${LOCAL_DIR}` }; - lib/docs.js:134-136 (helper)topicFromPath() — strips docs/ prefix and .md suffix from a file path to produce the topic name.
function topicFromPath(p) { return p.replace(/^docs\//, "").replace(/\.md$/, ""); }