Skip to main content
Glama
bscott

NotePlan MCP Server

by bscott

create_note

Create a new note in NotePlan with a title, content, and optional folder location to organize your thoughts and information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesThe title of the note
contentNoThe content of the note
folderNoThe folder to create the note in

Implementation Reference

  • Core implementation of note creation logic: sanitizes title for filename, writes Markdown file to NotePlan directory (or mock DB), parses and returns the new note object.
    function createNote(noteData: CreateNoteParams): Note {
      if (!noteData.title) {
        throw new Error('Note title is required');
      }
      
      const now = new Date();
      const timestamp = now.toISOString();
      
      // Generate filename from title (sanitize for filesystem)
      const sanitizedTitle = noteData.title
        .replace(/[^a-zA-Z0-9\s-_]/g, '')
        .replace(/\s+/g, '-')
        .substring(0, 50);
      
      const filename = `${sanitizedTitle}-${Date.now()}`;
      const noteId = `note-${filename}`;
      
      // Prepare content with title as markdown header
      const content = noteData.content ? 
        `# ${noteData.title}\n\n${noteData.content}` : 
        `# ${noteData.title}\n\n`;
      
      if (isNotePlanAvailable()) {
        // Determine target directory
        const targetFolder = noteData.folder || 'Notes';
        let targetPath = NOTES_PATH;
        
        if (targetFolder !== 'Notes' && targetFolder !== 'Calendar') {
          targetPath = path.join(NOTES_PATH, targetFolder);
          
          // Create subfolder if it doesn't exist
          if (!fs.existsSync(targetPath)) {
            fs.mkdirSync(targetPath, { recursive: true });
          }
        }
        
        const filePath = path.join(targetPath, `${filename}.md`);
        
        try {
          fs.writeFileSync(filePath, content, 'utf8');
          
          // Clear cache to force refresh
          notesCache = [];
          lastCacheUpdate = 0;
          
          // Return the newly created note
          return parseMarkdownFile(filePath, targetFolder)!;
        } catch (error) {
          throw new Error(`Failed to create note: ${(error as Error).message}`);
        }
      } else {
        // Fallback to mock database
        const newNote: Note = {
          id: noteId,
          title: noteData.title,
          content,
          created: timestamp,
          modified: timestamp,
          folder: noteData.folder || 'Notes'
        };
        
        notesDb.push(newNote);
        return newNote;
      }
    }
  • TypeScript interface defining the input parameters for the createNote function.
    interface CreateNoteParams {
      title: string;
      content?: string;
      folder?: string;
    }
  • src/index.ts:92-110 (registration)
    MCP tool registration for 'create_note': defines Zod input schema matching CreateNoteParams and thin handler wrapper that calls noteService.createNote and returns JSON stringified response.
    server.tool(
      'create_note',
      {
        title: z.string().describe('The title of the note'),
        content: z.string().optional().describe('The content of the note'),
        folder: z.string().optional().describe('The folder to create the note in'),
      },
      async ({ title, content, folder }) => {
        const newNote = noteService.createNote({ title, content, folder });
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(newNote, null, 2),
            },
          ],
        };
      }
    );
Behavior1/5

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

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

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

Completeness1/5

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

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

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/bscott/noteplan-mcp'

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