Skip to main content
Glama

zk_update_note

Modify existing notes in a Zettelkasten system by updating title, content, type, or tags. Use this tool to keep your knowledge base organized and relevant.

Instructions

Update an existing note. Args: note_id: The ID of the note to update title: New title (optional) content: New content (optional) note_type: New note type (optional) tags: New comma-separated list of tags (optional)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentNo
note_idYes
note_typeNo
tagsNo
titleNo

Implementation Reference

  • The main handler function for the zk_update_note MCP tool. It handles input validation, note retrieval, type/tag conversion, calls the ZettelService for update, and formats the response.
    def zk_update_note(
        note_id: str,
        title: str | None = None,
        content: str | None = None,
        note_type: str | None = None,
        tags: str | None = None,
    ) -> str:
        """Update the title, content, type, or tags of an existing note.
    
        Args:
            note_id: The unique ID of the note to update
            title: New title for the note (optional)
            content: New markdown content for the note (optional)
            note_type: New note type - one of: fleeting, literature, permanent, structure, hub (optional)
            tags: New comma-separated list of tags, or empty string to clear tags (optional)
        """
        try:
            # Get the note
            note = self.zettel_service.get_note(str(note_id))
            if not note:
                return f"Note not found: {note_id}"
    
            # Convert note_type string to enum if provided
            note_type_enum = None
            if note_type:
                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 if provided
            tag_list = None
            if tags is not None:  # Allow empty string to clear tags
                tag_list = [t.strip() for t in tags.split(",") if t.strip()]
    
            # Update the note
            updated_note = self.zettel_service.update_note(
                note_id=note_id,
                title=title,
                content=content,
                note_type=note_type_enum,
                tags=tag_list,
            )
            return f"Note updated successfully: {updated_note.id}"
        except Exception as e:
            return self.format_error_response(e)
  • Registration of the zk_update_note tool in the MCP server using the @mcp.tool decorator, specifying name, description, and operational hints.
    @self.mcp.tool(
        name="zk_update_note",
        description="Update the title, content, type, or tags of an existing note.",
        annotations={
            "readOnlyHint": False,
            "destructiveHint": False,
            "idempotentHint": True,
        },
    )
  • Supporting ZettelService.update_note method that implements the core update logic: retrieves note, conditionally updates fields, sets timestamp, and persists via repository.
    def update_note(
        self,
        note_id: str,
        title: Optional[str] = None,
        content: Optional[str] = None,
        note_type: Optional[NoteType] = None,
        tags: Optional[List[str]] = None,
        metadata: Optional[Dict[str, Any]] = None
    ) -> Note:
        """Update an existing note."""
        note = self.repository.get(note_id)
        if not note:
            raise ValueError(f"Note with ID {note_id} not found")
        
        # Update fields
        if title is not None:
            note.title = title
        if content is not None:
            note.content = content
        if note_type is not None:
            note.note_type = note_type
        if tags is not None:
            note.tags = [Tag(name=tag) for tag in tags]
        if metadata is not None:
            note.metadata = metadata
        
        note.updated_at = datetime.datetime.now()
        
        # Save to repository
        return self.repository.update(note)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is an update operation (implying mutation), but doesn't describe what happens with partial updates, whether changes are reversible, what permissions are required, or what the response looks like. For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 efficiently structured with a clear purpose statement followed by parameter documentation. The parameter list is formatted for readability. While concise, the purpose statement could be slightly more specific about what 'update' entails beyond changing fields.

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

Completeness2/5

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

For a mutation tool with 5 parameters, 0% schema description coverage, no annotations, and no output schema, the description is incomplete. It covers the basic operation and parameters but lacks crucial context about behavioral traits, error conditions, return values, and usage guidelines relative to sibling tools.

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

Parameters3/5

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

The description lists all 5 parameters with brief explanations, adding value beyond the schema which has 0% description coverage. It clarifies that 'note_id' is required and other parameters are optional, and provides format hints (e.g., 'comma-separated list' for tags). However, it doesn't explain parameter constraints, valid values, or interactions between parameters.

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 ('Update') and resource ('an existing note'), making the purpose immediately understandable. It distinguishes this from creation tools like 'zk_create_note' by specifying it updates existing notes, though it doesn't explicitly contrast with all sibling tools like 'zk_delete_note' or 'zk_get_note'.

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 prerequisites (e.g., needing the note ID from a previous operation), when not to use it (e.g., for creating new notes), or how it differs from similar tools like 'zk_get_note' or 'zk_delete_note'.

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