Skip to main content
Glama
sayranovv
by sayranovv

create_note

Create a new Markdown note with a title, content, and optional tags to organize information in the Notes MCP Server.

Instructions

Create a new Markdown note

Args: title: Note title content: Note content tags: Optional comma-separated list of tags

Returns: Confirmation message of note creation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes
contentYes
tagsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'create_note' tool. Decorated with @mcp.tool(), it creates a new Markdown note file with timestamped filename, adds metadata like creation date and tags, writes the content, and returns a confirmation.
    def create_note(title: str, content: str, tags: str = "") -> str:
        """
        Create a new Markdown note
        
        Args:
            title: Note title
            content: Note content
            tags: Optional comma-separated list of tags
        
        Returns:
            Confirmation message of note creation
        """
        ensure_notes_dir()
        
        timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
        filename = f"{timestamp}_{sanitize_filename(title)}.md"
        filepath = os.path.join(NOTES_DIR, filename)
        
        note_content = f"# {title}\n\n"
        note_content += f"**Created:** {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n"
        if tags:
            note_content += f"**Tags:** {tags}\n"
        note_content += f"\n---\n\n{content}\n"
        
        with open(filepath, "w", encoding="utf-8") as f:
            f.write(note_content)
        
        return f"Note '{title}' created: {filename}"
  • Helper function to sanitize note titles for safe filenames, used in create_note.
    def sanitize_filename(title: str) -> str:
        """Converts a note title into a safe filename"""
        safe_title = re.sub(r'[^\w\s-]', '', title)
        safe_title = re.sub(r'\s+', '_', safe_title)
        return safe_title.lower()[:100]
  • Helper function to ensure the notes directory exists, called by create_note.
    def ensure_notes_dir():
        """Creates the notes directory if it does not exist"""
        Path(NOTES_DIR).mkdir(exist_ok=True)

Tool Definition Quality

Score is being calculated. Check back soon.

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/sayranovv/notes-mcp-server'

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