Skip to main content
Glama

save_mcp_docs

Store MCP documentation securely by saving text with a unique key for easy retrieval and future reference, enhancing project organization on the MCP Maker server.

Instructions

Saves MCP documentation text directly and stores it for future reference

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_textYes
keyYes

Implementation Reference

  • The core handler function for the save_mcp_docs tool. Validates input using Zod schema, initializes documentation storage if needed, calls saveDocumentation helper, and returns success or error response.
    export async function saveMcpDocs( options: DocOptions ): Promise<{ success: boolean; message: string }> { try { // Validate options const validatedOptions = saveDocsSchema.parse(options); // Initialize docs storage if it doesn't exist yet await initDocsStorage(); // Save the documentation await saveDocumentation(validatedOptions.key, validatedOptions.doc_text); return { success: true, message: `Documentation saved successfully with key: ${validatedOptions.key}`, }; } catch (error: any) { console.error(chalk.red("Error saving documentation:"), error); return { success: false, message: `Error saving documentation: ${error.message || String(error)}`, }; } }
  • src/server.ts:114-128 (registration)
    Registers the save_mcp_docs tool with the MCP server, including name, description, input schema validation, and delegation to the saveMcpDocs handler.
    // Register the save_mcp_docs tool server.tool( "save_mcp_docs", "Saves MCP documentation text directly and stores it for future reference", { key: z.string().min(1), doc_text: z.string().min(1), }, async (params: DocOptions) => { const result = await saveMcpDocs(params); return { content: [{ type: "text", text: result.message }], }; } );
  • Zod schema defining the input structure for save_mcp_docs (key and doc_text), used for validation in the handler.
    export const saveDocsSchema = z.object({ key: z.string().min(1), doc_text: z.string().min(1), });
  • Helper utility that persists the documentation content to a Markdown file in the .docs directory, called by the handler.
    export const saveDocumentation = async ( key: string, docText: string ): Promise<void> => { try { const filePath = path.join(DOCS_DIR, `${key}.md`); await writeFile(filePath, docText); console.log(chalk.green(`Documentation saved: ${key}`)); } catch (error) { console.error(chalk.red(`Error saving documentation ${key}:`), error); throw error; } };
  • Helper utility that ensures the documentation storage directory (.docs) exists, called by the handler.
    export const initDocsStorage = async (): Promise<void> => { await ensureDir(DOCS_DIR); console.log(chalk.green("Documentation storage initialized")); };

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