Skip to main content
Glama
mjpitz

RFC MCP Server

by mjpitz

get_rfc

Fetch RFC documents by number to access technical specifications and standards, supporting full text, metadata, or specific sections.

Instructions

Fetch an RFC document by its number

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numberYesRFC number (e.g. "2616")
formatNoOutput format (full, metadata, sections)full

Implementation Reference

  • The MCP tool handler for 'get_rfc' in the CallToolRequestSchema. Validates input, fetches RFC via service, formats output (full/metadata/sections), returns JSON text or error.
    case 'get_rfc': {
      if (typeof typedArgs.number !== 'string') {
        throw new McpError(
          ErrorCode.InvalidParams,
          'RFC number must be a string'
        );
      }
      
      try {
        const rfc = await rfcService.fetchRfc(typedArgs.number);
        
        // Format the output based on the requested format
        const format = typedArgs.format || 'full';
        let result;
        
        switch (format) {
          case 'metadata':
            result = rfc.metadata;
            break;
          case 'sections':
            result = rfc.sections;
            break;
          case 'full':
          default:
            result = rfc;
            break;
        }
        
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error fetching RFC ${typedArgs.number}: ${error}`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:126-146 (registration)
    Tool registration in ListToolsRequestSchema, defining name, description, and input schema for 'get_rfc'.
    {
      name: 'get_rfc',
      description: 'Fetch an RFC document by its number',
      inputSchema: {
        type: 'object',
        properties: {
          number: {
            type: 'string',
            description: 'RFC number (e.g. "2616")',
          },
          format: {
            type: 'string',
            description: 'Output format (full, metadata, sections)',
            enum: ['full', 'metadata', 'sections'],
            default: 'full',
          },
        },
        required: ['number'],
        additionalProperties: false,
      },
    },
  • Input schema definition for the 'get_rfc' tool, specifying parameters 'number' (required) and optional 'format'.
    inputSchema: {
      type: 'object',
      properties: {
        number: {
          type: 'string',
          description: 'RFC number (e.g. "2616")',
        },
        format: {
          type: 'string',
          description: 'Output format (full, metadata, sections)',
          enum: ['full', 'metadata', 'sections'],
          default: 'full',
        },
      },
      required: ['number'],
      additionalProperties: false,
  • Core helper function fetchRfc that retrieves RFC content from IETF URLs (HTML preferred, TXT fallback), parses structure, caches result, returns RfcContent object.
    async fetchRfc(rfcNumber: string): Promise<RfcContent> {
      // Check cache first
      if (this.cache.has(rfcNumber)) {
        return this.cache.get(rfcNumber)!;
      }
    
      // Fetch the RFC in both HTML and TXT formats
      const txtUrl = `${this.baseUrl}/rfc${rfcNumber}.txt`;
      const htmlUrl = `${this.baseUrl}/rfc${rfcNumber}/`;
    
      try {
        // Try HTML first for better structure
        const htmlResponse = await axios.get(htmlUrl);
        const rfc = this.parseHtmlRfc(htmlResponse.data, rfcNumber, htmlUrl);
        this.cache.set(rfcNumber, rfc);
        return rfc;
      } catch (error) {
        try {
          // Fallback to TXT format
          console.error(`Failed to fetch HTML format for RFC ${rfcNumber}, trying TXT format`);
          const txtResponse = await axios.get(txtUrl);
          const rfc = this.parseTxtRfc(txtResponse.data, rfcNumber, txtUrl);
          this.cache.set(rfcNumber, rfc);
          return rfc;
        } catch (txtError) {
          throw new Error(`Failed to fetch RFC ${rfcNumber}: ${txtError}`);
        }
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It lacks details on behavioral traits such as error handling, rate limits, authentication needs, or what 'fetch' entails (e.g., network call, cached data). This leaves significant gaps in understanding how the tool behaves.

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, clear sentence with zero wasted words, making it highly efficient and front-loaded. It directly communicates the core purpose without unnecessary elaboration.

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

Completeness3/5

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

For a simple read operation with 2 parameters and no output schema, the description is minimally adequate but incomplete. It lacks context on usage guidelines and behavioral transparency, which are important given the absence of annotations and output schema, leaving room for improvement.

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 schema fully documents both parameters. The description adds no additional meaning beyond implying the 'number' parameter is used for fetching, which aligns with the schema. This meets the baseline for high schema 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 ('RFC document by its number'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'get_rfc_section' or 'search_rfcs', which prevents a perfect score.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_rfc_section' or 'search_rfcs'. The description only states what it does, not when it's appropriate, leaving the agent without context for tool selection.

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/mjpitz/mcp-rfc'

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