Skip to main content
Glama
9Ninety
by 9Ninety

deleteNote

Remove a specific note from the MCP Notes server by providing its unique ID, ensuring precise management of stored records.

Instructions

Deletes a specific note by its ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the note to delete

Implementation Reference

  • The core handler function that performs the deletion of a note from the DynamoDB table and updates the ALL_RESOURCES list by removing the deleted note's resource.
    export const handleDeleteNote = async (
      docClient: DynamoDBDocumentClient,
      tableName: string,
      id: string,
      ALL_RESOURCES: Resource[]
    ) => {
      const command = new DeleteCommand({ TableName: tableName, Key: { id } });
      await docClient.send(command);
    
      const index = ALL_RESOURCES.findIndex(
        (res) => res.uri === `notes://notes/${id}`
      );
      if (index !== -1) {
        ALL_RESOURCES.splice(index, 1);
      }
    
      return {
        content: [{ type: "text", text: `Note with ID '${id}' has been deleted.` }],
      };
    };
  • Zod input schema for the deleteNote tool, validating the 'id' parameter.
    export const DeleteNoteInputSchema = z.object({
      id: z.string().describe("ID of the note to delete"),
    });
  • Definition of the MCP 'deleteNote' tool within the getTools() function, specifying name, description, and input schema.
    {
      name: ToolName.DELETE_NOTE,
      description: "Deletes a specific note by its ID.",
      inputSchema: zodToJsonSchema(DeleteNoteInputSchema) as Tool["inputSchema"],
    },
  • Dispatch logic in the CallToolRequest handler that parses input and invokes the deleteNote handler.
    case ToolName.DELETE_NOTE: {
      const { id: deleteNoteId } = DeleteNoteInputSchema.parse(args);
      return handleDeleteNote(
        docClient,
        tableName,
        deleteNoteId,
        ALL_RESOURCES
      );
    }
  • Enum definition for the tool name constant 'deleteNote'.
    DELETE_NOTE = "deleteNote",
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/9Ninety/MCPNotes'

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