Skip to main content
Glama

delete_note

Remove unwanted notes from your Markdown collection by specifying the filename to delete. This tool helps maintain organized note management by eliminating unnecessary files.

Instructions

Delete a note

Args: filename: Note filename

Returns: Confirmation message of deletion

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes

Implementation Reference

  • The main handler function for the 'delete_note' tool. Decorated with @mcp.tool() which registers it as an MCP tool. Includes type hints (filename: str -> str) and docstring defining the input/output schema. Implements logic to ensure directory exists, check file, remove it, and return confirmation.
    @mcp.tool() def delete_note(filename: str) -> str: """ Delete a note Args: filename: Note filename Returns: Confirmation message of deletion """ ensure_notes_dir() filepath = os.path.join(NOTES_DIR, filename) if not os.path.exists(filepath): return f"Note '{filename}' not found" os.remove(filepath) return f"Note '{filename}' deleted"
  • Supporting helper function called by delete_note to ensure the notes directory exists before attempting to delete a file.
    def ensure_notes_dir(): """Creates the notes directory if it does not exist""" Path(NOTES_DIR).mkdir(exist_ok=True)
  • The @mcp.tool() decorator registers the delete_note function as an MCP tool.
    @mcp.tool()

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