roam_markdown_cheatsheet
Access Roam Research's markdown formatting guide to learn syntax for creating and editing content in your knowledge graph.
Instructions
Provides the content of the Roam Markdown Cheatsheet resource, optionally concatenated with custom instructions if CUSTOM_INSTRUCTIONS_PATH is set.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/tool-handlers.ts:144-176 (handler)The handler function that loads, caches, and returns the Roam Markdown Cheatsheet content, optionally appending custom instructions from an environment-specified path.async getRoamMarkdownCheatsheet() { if (this.cachedCheatsheet) { return this.cachedCheatsheet; } const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const cheatsheetPath = path.join(__dirname, '../../Roam_Markdown_Cheatsheet.md'); try { let cheatsheetContent = await fs.promises.readFile(cheatsheetPath, 'utf-8'); const customInstructionsPath = process.env.CUSTOM_INSTRUCTIONS_PATH; if (customInstructionsPath) { try { // Check if file exists asynchronously await fs.promises.access(customInstructionsPath); const customInstructionsContent = await fs.promises.readFile(customInstructionsPath, 'utf-8'); cheatsheetContent += `\n\n${customInstructionsContent}`; } catch (error) { // File doesn't exist or is not readable, ignore custom instructions if ((error as NodeJS.ErrnoException).code !== 'ENOENT') { console.warn(`Could not read custom instructions file at ${customInstructionsPath}: ${error}`); } } } this.cachedCheatsheet = cheatsheetContent; return cheatsheetContent; } catch (error) { throw new Error(`Failed to read cheatsheet: ${error}`); } }
- src/tools/schemas.ts:405-413 (schema)The schema definition for the 'roam_markdown_cheatsheet' tool, including name, description, and empty input schema (no parameters required).[toolName(BASE_TOOL_NAMES.MARKDOWN_CHEATSHEET)]: { name: toolName(BASE_TOOL_NAMES.MARKDOWN_CHEATSHEET), description: 'Provides the content of the Roam Markdown Cheatsheet resource, optionally concatenated with custom instructions if CUSTOM_INSTRUCTIONS_PATH is set.', inputSchema: { type: 'object', properties: {}, required: [], }, },
- src/server/roam-server.ts:117-122 (registration)The registration and dispatching logic in the MCP server request handler that routes calls to 'roam_markdown_cheatsheet' to the corresponding tool handler method.case BASE_TOOL_NAMES.MARKDOWN_CHEATSHEET: { const content = await this.toolHandlers.getRoamMarkdownCheatsheet(); return { content: [{ type: 'text', text: content }], }; }