Skip to main content
Glama

get_mcp_doc_section

Retrieve a specific section of MCP documentation using a key and section title to locate and access relevant content for MCP server projects.

Instructions

Get a specific section of MCP documentation by key and section title

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes
section_titleNo

Implementation Reference

  • Main handler function that validates input using Zod schema, initializes docs storage, retrieves the specific documentation section using helper function, handles errors, and returns structured result.
    export async function getMcpDocSection( options: DocSectionOptions ): Promise<{ success: boolean; message: string; content?: string }> { try { // Validate options const validatedOptions = docSectionSchema.parse(options); // Initialize docs storage if it doesn't exist yet await initDocsStorage(); // Get the documentation section const content = await getDocumentationSection( validatedOptions.key, validatedOptions.section_title ); if (!content) { return { success: false, message: validatedOptions.section_title ? `Section "${validatedOptions.section_title}" not found in documentation "${validatedOptions.key}"` : `Documentation "${validatedOptions.key}" not found`, }; } return { success: true, message: validatedOptions.section_title ? `Retrieved section "${validatedOptions.section_title}" from documentation "${validatedOptions.key}"` : `Retrieved documentation "${validatedOptions.key}"`, content, }; } catch (error: any) { console.error(chalk.red("Error retrieving documentation section:"), error); return { success: false, message: `Error retrieving documentation section: ${ error.message || String(error) }`, }; } }
  • Zod schema for input validation of the get_mcp_doc_section tool parameters.
    export const docSectionSchema = z.object({ key: z.string().min(1), section_title: z.string().optional(), });
  • src/server.ts:162-182 (registration)
    Registration of the get_mcp_doc_section tool on the MCP server, including inline Zod schema, description, and handler invocation.
    server.tool( "get_mcp_doc_section", "Get a specific section of MCP documentation by key and section title", { key: z.string().min(1), section_title: z.string().optional(), }, async (params: DocSectionOptions) => { const result = await getMcpDocSection(params); return { content: [ { type: "text", text: result.success && result.content ? result.content : result.message, }, ], }; } );
  • TypeScript interface defining the input options for the get_mcp_doc_section tool.
    export interface DocSectionOptions { key: string; section_title?: string; }

Other Tools

Related 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/CaptainCrouton89/mcp-maker'

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