discover_docs
Crawl and index all available documentation paths on the Tambo Docs MCP Server to enable AI assistants to discover, fetch, and search technical content efficiently.
Instructions
Crawl the main docs page to discover all available documentation paths
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/doc-handler.ts:10-63 (handler)Core implementation of the discover_docs tool. Fetches the main documentation page from https://docs.tambo.co/, parses links using Cheerio to discover documentation sections, deduplicates and sorts them, stores in instance state, and returns a formatted list.async discoverDocs(): Promise<CallToolResult> { try { const response = await fetch('https://docs.tambo.co/'); if (!response.ok) { throw new Error(`Failed to fetch main docs page: ${response.status}`); } const html = await response.text(); const $ = cheerio.load(html); const discoveredSections: DocSection[] = []; $('a[href]').each((_, element) => { const href = $(element).attr('href'); const text = $(element).text().trim(); if (href && href.startsWith('/') && !href.startsWith('//') && text) { if (href.includes('/docs/') || href.match(/^\/(concepts?|api|cli|examples?|getting-started|guides?)/)) { const category = this.extractCategory(href); discoveredSections.push({ path: href, title: text, category }); } } }); const uniqueSections = discoveredSections .filter((section, index, self) => index === self.findIndex(s => s.path === section.path) ) .sort((a, b) => a.path.localeCompare(b.path)); this.sections = uniqueSections; this.sectionsLoaded = true; return { content: [ { type: 'text', text: `Discovered ${uniqueSections.length} documentation sections:\n\n${ uniqueSections.map(s => `• **${s.title}** - ${s.path}${s.category ? ` (${s.category})` : ''}` ).join('\n') }`, }, ], }; } catch (error) { throw new Error(`Failed to discover documentation: ${error instanceof Error ? error.message : String(error)}`); } }
- src/server.ts:72-78 (registration)Registration of the discover_docs tool in the ListToolsRequestSchema handler response. Includes the tool name, description, and input schema (empty object since no parameters required).name: 'discover_docs', description: 'Crawl the main docs page to discover all available documentation paths', inputSchema: { type: 'object', properties: {}, }, },
- src/server.ts:94-95 (registration)Dispatch logic in the CallToolRequestSchema handler switch statement that routes calls to the discover_docs tool to the DocHandler instance's discoverDocs method.case 'discover_docs': return await this.docHandler.discoverDocs();
- src/server.ts:74-77 (schema)Input schema definition for the discover_docs tool (empty object, no required parameters).inputSchema: { type: 'object', properties: {}, },