Skip to main content
Glama
cwente25

Knowledge Base MCP Server

by cwente25

delete_note

Remove a note from your knowledge base by specifying its category path and title to maintain organized information.

Instructions

Delete a note from the knowledge base

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
category_pathYesCategory path (e.g., 'work/clients/acme')
titleYesNote title

Implementation Reference

  • MCP tool handler that extracts arguments and delegates to storage.delete_note, returning success or error message.
    async def handle_delete_note(arguments: dict) -> list[TextContent]:
        """Handle delete_note tool call."""
        try:
            category_path = arguments["category_path"]
            title = arguments["title"]
    
            # Delete note
            result = storage.delete_note(category_path, title)
    
            return [TextContent(type="text", text=result)]
        except (NoteNotFoundError, StorageError) as e:
            return [TextContent(type="text", text=str(e))]
        except Exception as e:
            return [TextContent(type="text", text=f"❌ Error: {str(e)}")]
  • Tool registration in list_tools() including name, description, and input schema.
    Tool(
        name="delete_note",
        description="Delete a note from the knowledge base",
        inputSchema={
            "type": "object",
            "properties": {
                "category_path": {
                    "type": "string",
                    "description": "Category path (e.g., 'work/clients/acme')",
                },
                "title": {
                    "type": "string",
                    "description": "Note title",
                },
            },
            "required": ["category_path", "title"],
        },
    ),
  • Core storage method that locates the note file, creates a backup, deletes the file, and returns confirmation message.
    def delete_note(self, category_path: str, title: str) -> str:
        """
        Delete a note.
    
        Args:
            category_path: Category path (e.g., "work/clients/acme")
            title: Note title
    
        Returns:
            Success message
    
        Raises:
            NoteNotFoundError: If note doesn't exist
        """
        normalized = normalize_path(category_path)
        file_path = self._get_note_path(normalized, title)
    
        if not file_path.exists():
            raise NoteNotFoundError(
                f"❌ Error: Note '{title}' not found in {normalized or 'root'}/\n"
                f"💡 Tip: Use list_notes to see available notes"
            )
    
        # Create backup before deletion
        backup_path = file_path.with_suffix('.md.deleted')
        shutil.copy2(file_path, backup_path)
    
        # Delete the file
        file_path.unlink()
    
        return f"✓ Note '{title}' deleted from {normalized or 'root'}/"
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Delete') but doesn't describe consequences (e.g., irreversible deletion, no confirmation prompt), permissions required, error conditions (e.g., if note doesn't exist), or response format. For a destructive tool with zero annotation coverage, this is a significant gap.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero wasted words. It is appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration. Every word earns its place.

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?

Given the complexity (a destructive deletion tool), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like irreversibility, permissions, or error handling, which are critical for safe tool invocation. The description should do more to compensate for missing structured data.

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?

Schema description coverage is 100%, with both parameters ('category_path' and 'title') clearly documented in the schema. The description adds no parameter-specific information beyond what the schema provides. According to rules, when coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 ('Delete') and resource ('a note from the knowledge base'), making the purpose unambiguous. It distinguishes this from siblings like 'add_note', 'update_note', or 'get_note' by specifying deletion. However, it doesn't explicitly differentiate from 'delete_category', which targets a different resource type.

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., the note must exist), exclusions (e.g., cannot delete notes in read-only categories), or comparisons to siblings like 'delete_category' or 'update_note'. Usage is implied but not explicitly stated.

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/cwente25/KnowledgeBaseMCP'

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