Skip to main content
Glama
jasonkneen

Simple TypeScript MCP Server

by jasonkneen

deleteNote

Remove a specific note from the Simple TypeScript MCP Server by providing its unique ID to manage your note collection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteIdYesThe ID of the note to delete

Implementation Reference

  • MCP tool registration and handler for 'deleteNote'. Defines input schema using Zod, executes the deletion by calling notesStore.deleteNote(noteId), handles errors and returns structured JSON response via MCP content format.
    server.tool( "deleteNote", { noteId: z.string().describe("The ID of the note to delete") }, async ({ noteId }) => { try { const deleted = notesStore.deleteNote(noteId); if (!deleted) { return { content: [ { type: "text", text: JSON.stringify({ success: false, error: "Note not found", noteId }, null, 2) } ] }; } return { content: [ { type: "text", text: JSON.stringify({ success: true, message: "Note deleted successfully", noteId }, null, 2) } ] }; } catch (err) { return { content: [ { type: "text", text: JSON.stringify({ success: false, error: "Failed to delete note", noteId }, null, 2) } ] }; } }, );
  • Input schema for deleteNote tool using Zod for noteId validation.
    { noteId: z.string().describe("The ID of the note to delete") },
  • Core implementation of deleteNote in NotesStore class: checks if note exists, deletes it from in-memory store, returns boolean success indicator.
    deleteNote(id: string): boolean { const note = this.notes[id]; if (!note) { return false; } delete this.notes[id]; return true; }

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/jasonkneen/mcp-server-ts'

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