Skip to main content
Glama
kylegrahammatzen

Tambo Docs MCP Server

fetch_docs

Retrieve documentation content from Tambo's technical documentation site by specifying the path to access specific technical resources and information.

Instructions

Fetch documentation content from docs.tambo.co

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesThe documentation path to fetch (e.g., /concepts/components)

Implementation Reference

  • The core handler function that fetches documentation from docs.tambo.co for the given path, parses HTML with cheerio, extracts title and content, caches the result, and returns it as CallToolResult.
    async fetchDocs(path: string): Promise<CallToolResult> {
      if (!path) {
        throw new Error('Path is required');
      }
    
      const url = `https://docs.tambo.co${path}`;
      const cacheKey = `docs:${path}`;
      
      const cached = this.cache.get(cacheKey);
      if (cached && Date.now() - cached.timestamp < 10 * 60 * 1000) {
        return cached.content;
      }
    
      try {
        const response = await fetch(url);
        if (!response.ok) {
          throw new Error(`Failed to fetch ${url}: ${response.status}`);
        }
    
        const html = await response.text();
        const $ = cheerio.load(html);
        
        const title = $('h1').first().text().trim() || 
                     $('[data-title]').first().text().trim() ||
                     $('title').text().trim();
        
        let contentElement = $('main').first();
        if (contentElement.length === 0) {
          contentElement = $('article').first();
        }
        if (contentElement.length === 0) {
          contentElement = $('.content, [data-content], .markdown-body').first();
        }
        
        const content = contentElement.length > 0 ? contentElement.html() : '';
        const cleanContent = content ? 
          cheerio.load(content).text().replace(/\s+/g, ' ').trim() : 
          'No content found';
    
        const result: CallToolResult = {
          content: [
            {
              type: 'text',
              text: `# ${title}\n\nPath: ${path}\nURL: ${url}\n\n${cleanContent}`,
            },
          ],
        };
    
        this.cache.set(cacheKey, {
          content: result,
          timestamp: Date.now()
        });
    
        return result;
      } catch (error) {
        throw new Error(`Failed to fetch documentation: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • Defines the input schema for the fetch_docs tool: an object requiring a 'path' string.
      type: 'object',
      properties: {
        path: {
          type: 'string',
          description: 'The documentation path to fetch (e.g., /concepts/components)',
        },
      },
      required: ['path'],
    },
  • src/server.ts:35-48 (registration)
    Registers the fetch_docs tool in the ListTools response with name, description, and input schema.
    {
      name: 'fetch_docs',
      description: 'Fetch documentation content from docs.tambo.co',
      inputSchema: {
        type: 'object',
        properties: {
          path: {
            type: 'string',
            description: 'The documentation path to fetch (e.g., /concepts/components)',
          },
        },
        required: ['path'],
      },
    },
  • src/server.ts:88-89 (registration)
    Dispatches calls to fetch_docs by invoking the docHandler.fetchDocs method in the CallTool request handler.
    case 'fetch_docs':
      return await this.docHandler.fetchDocs(args?.path as string);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool fetches content but doesn't describe any behavioral traits such as read-only status, potential errors, rate limits, or authentication needs. This leaves significant gaps for a tool that interacts with external documentation.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary elaboration.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., raw content, structured data), potential side effects, or error handling, which are crucial for an agent to use it effectively in a documentation context.

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

Parameters3/5

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

Schema description coverage is 100%, so the input schema already documents the 'path' parameter with an example. The description adds no additional meaning or context beyond what the schema provides, such as path format constraints or common use cases, meeting the baseline for high coverage.

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

Purpose4/5

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

The description clearly states the action ('fetch') and resource ('documentation content from docs.tambo.co'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'discover_docs', 'list_sections', or 'search_docs', which likely have overlapping or related functionality.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any context, prerequisites, or exclusions, leaving the agent to infer usage based on tool names alone.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kylegrahammatzen/tambo-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server