Skip to main content
Glama
90barricade93

MSFS SDK MCP Server

get_doc_content

Retrieve detailed content from Microsoft Flight Simulator SDK documentation pages to access specific sections like overview, examples, or API references.

Instructions

Get detailed content from a specific MSFS SDK documentation page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL of the documentation page to retrieve
sectionNoSpecific section to extract (e.g., "overview", "examples", "api-reference")

Implementation Reference

  • The primary handler function executing the 'get_doc_content' tool: fetches HTML from the provided URL, parses with Cheerio, extracts main content (specific section if provided), title, code examples, and returns formatted text response.
    async getDocumentationContent(
      url: string,
      section?: string
    ): Promise<{ content: Array<{ type: string; text: string }> }> {
      try {
        const fetchResponse = await fetch(url);
    
        if (!fetchResponse.ok) {
          throw new Error(`Failed to fetch documentation: ${fetchResponse.status}`);
        }
    
        const html = await fetchResponse.text();
        const $ = cheerio.load(html);
    
        // Remove navigation and headers
        $('nav, header, footer, .navigation, .toc').remove();
    
        let contentText = '';
        let title = $('title').text() || 'MSFS SDK Documentation';
    
        if (section) {
          // Try to find specific section
          const sectionElement = $(`#${section}, .${section}, [data-section="${section}"]`);
          if (sectionElement.length > 0) {
            contentText = sectionElement.text().trim();
          } else {
            contentText = $('main, .content, body').text().trim();
          }
        } else {
          contentText = $('main, .content, body').text().trim();
        }
    
        // Extract code examples
        const codeExamples: string[] = [];
        $('code, pre').each((_, element) => {
          const code = $(element).text().trim();
          if (code.length > 10) { // Filter out small snippets
            codeExamples.push(code);
          }
        });
    
        const formattedContent = `**${title}**\n\nURL: ${url}\n\n${contentText.substring(0, 4000)}${contentText.length > 4000 ? '...' : ''}`;
    
        let finalResponse = formattedContent;
    
        if (codeExamples.length > 0) {
          finalResponse += '\n\n**Code Examples:**\n';
          codeExamples.slice(0, 3).forEach((example, index) => {
            finalResponse += `\n\nExample ${index + 1}:\n\`\`\`\n${example}\n\`\`\``;
          });
        }
    
        return {
          content: [
            {
              type: 'text',
              text: finalResponse,
            },
          ],
        };
    
      } catch (error) {
        throw new Error(`Failed to get documentation content: ${error}`);
      }
    }
  • Input schema definition for the 'get_doc_content' tool, specifying required 'url' parameter and optional 'section'.
      name: 'get_doc_content',
      description: 'Get detailed content from a specific MSFS SDK documentation page',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: 'URL of the documentation page to retrieve',
          },
          section: {
            type: 'string',
            description: 'Specific section to extract (e.g., "overview", "examples", "api-reference")',
          }
        },
        required: ['url']
      }
    },
  • src/index.ts:137-145 (registration)
    Tool registration and dispatch in the main CallToolRequest handler switch for direct 'get_doc_content' calls.
    case 'get_doc_content':
      if (!args?.url) {
        throw new Error('URL parameter is required');
      }
      return await this.documentationService.getDocumentationContent(
        String(args.url),
        args.section ? String(args.section) : undefined
      );
  • src/index.ts:170-175 (registration)
    Tool dispatch registration within the natural language query parsing switch case.
    case 'get_doc_content':
      return await this.documentationService.getDocumentationContent(
        String(parsedCommand.arguments.url),
        parsedCommand.arguments.section ? String(parsedCommand.arguments.section) : undefined
      );
  • Natural language parsing helper that detects 'Get content for [url]' patterns and maps them to the 'get_doc_content' tool with extracted URL.
    const contentPattern = /^Get\s+content\s+for\s+(https?:\/\/.+)$/i;
    const contentMatch = command.match(contentPattern);
    
    if (contentMatch) {
      const url = contentMatch[1];
      return {
        tool: "get_doc_content",
        arguments: {
          url: url
        }
      };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves content but lacks details on permissions, rate limits, error handling, or output format. This is a significant gap for a tool that likely involves network requests and content extraction.

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 that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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 complexity of retrieving documentation content (involving URLs and optional sections), no annotations, and no output schema, the description is incomplete. It doesn't explain what 'detailed content' includes, how errors are handled, or any behavioral traits, leaving gaps for effective tool use.

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?

The schema description coverage is 100%, so the schema already documents both parameters ('url' and 'section') adequately. The description adds no additional meaning beyond implying content extraction, which aligns with the schema but doesn't provide extra context like URL format requirements or section handling specifics.

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 ('Get detailed content') and resource ('specific MSFS SDK documentation page'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'search_msfs_docs' or 'natural_language_query', which might also retrieve documentation content through different mechanisms.

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 prerequisites (e.g., needing a valid URL), exclusions, or comparisons to sibling tools like 'search_msfs_docs' for broader searches or 'natural_language_query' for query-based retrieval.

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/90barricade93/MSFS-SDK-MCP'

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