discover_docs
Crawl the main documentation page to find all available documentation paths for AI assistants accessing Tambo technical documentation.
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)The discoverDocs method in DocHandler class implements the core tool logic: fetches the main docs page, parses links with 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:71-78 (registration)Tool registration in the ListToolsRequest handler: defines the tool name 'discover_docs', its description, and empty input schema.{ 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 CallToolRequest handler: matches on tool name and delegates to docHandler.discoverDocs() method.case 'discover_docs': return await this.docHandler.discoverDocs();
- src/server.ts:74-77 (schema)Input schema definition for discover_docs tool: accepts no parameters (empty object).inputSchema: { type: 'object', properties: {}, },