Skip to main content
Glama

zk_create_note

Generate and organize Zettelkasten notes with structured titles, content, types, and optional tags to enhance knowledge management and idea synthesis.

Instructions

Create a new Zettelkasten note. Args: title: The title of the note content: The main content of the note note_type: Type of note (fleeting, literature, permanent, structure, hub) tags: Comma-separated list of tags (optional)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
note_typeNopermanent
tagsNo
titleYes

Implementation Reference

  • MCP tool registration decorator defining the tool name, description, and operational hints.
    @self.mcp.tool(
        name="zk_create_note",
        description="Create a new atomic Zettelkasten note with a unique ID, content, and optional tags.",
        annotations={
            "readOnlyHint": False,
            "destructiveHint": False,
            "idempotentHint": False,
        },
    )
  • The primary handler function for the zk_create_note tool. Validates input parameters, converts types, calls ZettelService.create_note, and returns success/error messages.
    def zk_create_note(
        title: str,
        content: str,
        note_type: str = "permanent",
        tags: str | None = None,
    ) -> str:
        """Create a new atomic Zettelkasten note with a unique ID, content, and optional tags.
    
        Args:
            title: The title of the note
            content: The main content of the note in markdown format
            note_type: Type of note - one of: fleeting, literature, permanent, structure, hub (default: permanent)
            tags: Optional comma-separated list of tags for categorization
        """
        try:
            # Convert note_type string to enum
            try:
                note_type_enum = NoteType(note_type.lower())
            except ValueError:
                return f"Invalid note type: {note_type}. Valid types are: {', '.join(t.value for t in NoteType)}"
    
            # Convert tags string to list
            tag_list = []
            if tags:
                tag_list = [t.strip() for t in tags.split(",") if t.strip()]
    
            # Create the note
            note = self.zettel_service.create_note(
                title=title,
                content=content,
                note_type=note_type_enum,
                tags=tag_list,
            )
            return f"Note created successfully with ID: {note.id}"
        except Exception as e:
            return self.format_error_response(e)
  • Helper service method in ZettelService that instantiates a Note model and delegates persistence to the NoteRepository.
    def create_note(
        self,
        title: str,
        content: str,
        note_type: NoteType = NoteType.PERMANENT,
        tags: Optional[List[str]] = None,
        metadata: Optional[Dict[str, Any]] = None
    ) -> Note:
        """Create a new note."""
        if not title:
            raise ValueError("Title is required")
        if not content:
            raise ValueError("Content is required")
        
        # Create note object
        note = Note(
            title=title,
            content=content,
            note_type=note_type,
            tags=[Tag(name=tag) for tag in (tags or [])],
            metadata=metadata or {}
        )
        
        # Save to repository
        return self.repository.create(note)
  • Pydantic enum defining valid note types used for input validation in the tool handler.
    class NoteType(str, Enum):
        """Types of notes in a Zettelkasten."""
        FLEETING = "fleeting"    # Quick, temporary notes
        LITERATURE = "literature"  # Notes from reading material
        PERMANENT = "permanent"  # Permanent, well-formulated notes
        STRUCTURE = "structure"  # Structure/index notes that organize other notes
        HUB = "hub"              # Hub notes that serve as entry points
  • Pydantic model defining the structure of a Note, used when creating notes via the service layer.
    class Note(BaseModel):
        """A Zettelkasten note."""
        id: str = Field(default_factory=generate_id, description="Unique ID of the note")
        title: str = Field(..., description="Title of the note")
        content: str = Field(..., description="Content of the note")
        note_type: NoteType = Field(default=NoteType.PERMANENT, description="Type of note")
        tags: List[Tag] = Field(default_factory=list, description="Tags for categorization")
        links: List[Link] = Field(default_factory=list, description="Links to other notes")
        created_at: datetime.datetime = Field(
            default_factory=datetime.datetime.now,
            description="When the note was created"
        )
        updated_at: datetime.datetime = Field(
            default_factory=datetime.datetime.now,
            description="When the note was last updated"
        )
        metadata: Dict[str, Any] = Field(
            default_factory=dict, 
            description="Additional metadata for the note"
        )
        
        model_config = {
            "validate_assignment": True,
            "extra": "forbid"
        }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this creates a new note but doesn't describe what happens after creation (e.g., whether it returns the created note, assigns an ID, or how errors are handled). It mentions note_type options but doesn't explain their significance or default behavior. For a creation tool with zero annotation coverage, this leaves important behavioral aspects unspecified.

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

Conciseness4/5

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

The description is appropriately concise with a clear opening statement followed by parameter explanations. The parameter list is well-structured with brief but informative explanations. There's no unnecessary verbiage, though the formatting with indentation could be cleaner. Every sentence adds value without redundancy.

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

Completeness3/5

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

Given this is a creation tool with 4 parameters, 0% schema description coverage, no annotations, and no output schema, the description does an adequate but incomplete job. It covers the basic action and parameters but lacks information about what the tool returns, error conditions, or how it integrates with the Zettelkasten system. For a tool that presumably creates persistent data, more context about the creation outcome would be helpful.

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

Parameters4/5

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

The description provides meaningful semantic information for all parameters beyond the schema's 0% coverage. It explains that 'title' is the note's title, 'content' is the main content, 'note_type' has specific allowed values with examples, and 'tags' are optional and comma-separated. This compensates well for the schema's lack of descriptions, though it doesn't elaborate on format requirements or constraints.

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

Purpose4/5

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

The description clearly states the verb 'Create' and the resource 'Zettelkasten note', making the purpose immediately understandable. It distinguishes this from sibling tools like zk_update_note or zk_delete_note by specifying it's for creating new notes. However, it doesn't explicitly differentiate from other creation tools like zk_create_link, which slightly reduces specificity.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose zk_create_note over zk_update_note for modifications, or how it relates to sibling tools like zk_create_link. There's no context about prerequisites, constraints, or typical use cases beyond the basic action.

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

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/Liam-Deacon/zettelkasten-mcp'

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