get_rfc_section
Extract specific sections from IETF RFC documents by providing the RFC number and section identifier, enabling targeted access to technical specifications and protocols.
Instructions
Get a specific section from an RFC
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| number | Yes | RFC number (e.g. "2616") | |
| section | Yes | Section title or number to retrieve |
Implementation Reference
- src/index.ts:281-330 (handler)The handler for the 'get_rfc_section' tool. Validates parameters, fetches the RFC using rfcService, finds the section by case-insensitive title match, and returns the JSON stringified section or appropriate error.case 'get_rfc_section': { if (typeof typedArgs.number !== 'string' || typeof typedArgs.section !== 'string') { throw new McpError( ErrorCode.InvalidParams, 'RFC number and section must be strings' ); } try { const rfc = await rfcService.fetchRfc(typedArgs.number); // Find the matching section const sectionQuery = typedArgs.section.toLowerCase(); const section = rfc.sections.find(s => s.title.toLowerCase().includes(sectionQuery) || s.title.toLowerCase() === sectionQuery ); if (!section) { return { content: [ { type: 'text', text: `Section "${typedArgs.section}" not found in RFC ${typedArgs.number}`, }, ], isError: true, }; } return { content: [ { type: 'text', text: JSON.stringify(section, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching section from RFC ${typedArgs.number}: ${error}`, }, ], isError: true, }; } }
- src/index.ts:168-185 (registration)Registration of the 'get_rfc_section' tool in the MCP server tools list, including name, description, and input schema definition.name: 'get_rfc_section', description: 'Get a specific section from an RFC', inputSchema: { type: 'object', properties: { number: { type: 'string', description: 'RFC number (e.g. "2616")', }, section: { type: 'string', description: 'Section title or number to retrieve', }, }, required: ['number', 'section'], additionalProperties: false, }, },
- src/index.ts:170-184 (schema)Input schema validation for the 'get_rfc_section' tool parameters.inputSchema: { type: 'object', properties: { number: { type: 'string', description: 'RFC number (e.g. "2616")', }, section: { type: 'string', description: 'Section title or number to retrieve', }, }, required: ['number', 'section'], additionalProperties: false, },