Skip to main content
Glama
mariomosca

NotesKeep MCP Server

by mariomosca

set_note_labels

Assign or replace labels on a specific note in NotesKeep to organize and categorize content for better retrieval and management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteIdYesID of the note
labelIdsYesArray of label IDs to set (replaces all existing labels)

Implementation Reference

  • The handler function for the "set_note_labels" tool, which updates the labels of a note by making a PUT request to the API.
    async ({ noteId, labelIds }) => {
        try {
            await apiRequest(`/api/notes/${noteId}/labels`, {
                method: "PUT",
                body: JSON.stringify({ labelIds }),
            });
    
            return {
                content: [{
                    type: "text",
                    text: `Labels for note ${noteId} updated successfully! Now has ${labelIds.length} label(s).`
                }]
            };
        } catch (error) {
            return {
                content: [{
                    type: "text",
                    text: `Error setting note labels: ${error}`
                }],
                isError: true
            };
        }
    }
  • The input schema for the "set_note_labels" tool, defining the required noteId and labelIds fields.
    {
        noteId: z.number().describe("ID of the note"),
        labelIds: z.array(z.number()).describe("Array of label IDs to set (replaces all existing labels)"),
    },
  • src/index.ts:440-469 (registration)
    The registration of the "set_note_labels" tool using server.tool.
    server.tool(
        "set_note_labels",
        {
            noteId: z.number().describe("ID of the note"),
            labelIds: z.array(z.number()).describe("Array of label IDs to set (replaces all existing labels)"),
        },
        async ({ noteId, labelIds }) => {
            try {
                await apiRequest(`/api/notes/${noteId}/labels`, {
                    method: "PUT",
                    body: JSON.stringify({ labelIds }),
                });
    
                return {
                    content: [{
                        type: "text",
                        text: `Labels for note ${noteId} updated successfully! Now has ${labelIds.length} label(s).`
                    }]
                };
            } catch (error) {
                return {
                    content: [{
                        type: "text",
                        text: `Error setting note labels: ${error}`
                    }],
                    isError: 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/mariomosca/noteskeep-mcp'

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