List all docs
list_docsBrowse all available documents in the ProsodyAI documentation server. Filter by section like docs, sdks, recipes, or api to find specific content quickly.
Instructions
List every document in this server. Useful for browsing without a search query.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| section | No | Filter to a single section. |
Implementation Reference
- src/server.ts:86-115 (registration)Registration of the 'list_docs' tool with input schema and handler.
server.registerTool( "list_docs", { title: "List all docs", description: "List every document in this server. Useful for browsing without a search query.", inputSchema: { section: sectionEnum.optional().describe("Filter to a single section."), }, }, async ({ section }) => { const entries = await listEntries(section); if (!entries.length) return textResponse("No documents available."); const grouped = new Map<string, typeof entries>(); for (const e of entries) { const arr = grouped.get(e.section) ?? []; arr.push(e); grouped.set(e.section, arr); } const out: string[] = []; for (const [sec, items] of grouped) { out.push(`## ${sec}`); for (const item of items) { out.push(`- ${item.id} — ${item.title}`); } out.push(""); } return textResponse(out.join("\n")); }, ); - src/server.ts:96-114 (handler)Handler function that calls listEntries(section) and groups/returns results.
async ({ section }) => { const entries = await listEntries(section); if (!entries.length) return textResponse("No documents available."); const grouped = new Map<string, typeof entries>(); for (const e of entries) { const arr = grouped.get(e.section) ?? []; arr.push(e); grouped.set(e.section, arr); } const out: string[] = []; for (const [sec, items] of grouped) { out.push(`## ${sec}`); for (const item of items) { out.push(`- ${item.id} — ${item.title}`); } out.push(""); } return textResponse(out.join("\n")); }, - src/server.ts:92-94 (schema)Input schema definition for list_docs: optional section filter.
inputSchema: { section: sectionEnum.optional().describe("Filter to a single section."), }, - src/lib/content.ts:145-148 (helper)Helper function listEntries that returns all content entries, optionally filtered by section.
export async function listEntries(section?: ContentSection): Promise<ContentEntry[]> { const all = await loadContent(); return section ? all.filter((e) => e.section === section) : all; } - src/lib/content.ts:13-13 (helper)Type definition for ContentSection used by list_docs input schema.
export type ContentSection = "docs" | "sdks" | "recipes" | "api";