delete_note
Remove a note file from Nextcloud Notes by specifying its filename and optional category, enabling users to delete unwanted notes and manage their note collection.
Instructions
Delete a note file inside Notes.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filename": "<filename>"
},
"name": "delete_note"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| category | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- nextcloud_notes_mcp/server.py:164-174 (handler)The main handler function for the 'delete_note' tool, registered via @mcp.tool() decorator. It constructs the remote path and uses the WebDAV client to delete the note file.
@mcp.tool() def delete_note(filename: str, category: str | None = None) -> str: """ Delete a note file inside Notes. """ full_path = f"Notes/{category}/{filename}" if category else f"Notes/{filename}" try: client.clean(full_path) except Exception as e: return f"Failed to delete note: {str(e)}" return f"Note deleted successfully: {full_path}"