Skip to main content
Glama
mariomosca

NotesKeep MCP Server

by mariomosca

create_label

Create custom labels with color coding to organize and categorize notes in NotesKeep. Add labels to notes for better structure and quick retrieval.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the label
colorNoLabel colorgray

Implementation Reference

  • The handler function for the create_label tool, which performs an API request to /api/labels to create a new label.
    async ({ name, color }) => {
        try {
            const data = await apiRequest("/api/labels", {
                method: "POST",
                body: JSON.stringify({ name, color }),
            });
    
            return {
                content: [{
                    type: "text",
                    text: `Label created successfully!\nID: ${data.label.id}\nName: ${data.label.name}\nColor: ${data.label.color}`
                }]
            };
        } catch (error) {
            return {
                content: [{
                    type: "text",
                    text: `Error creating label: ${error}`
                }],
                isError: true
            };
        }
    }
  • Input validation schema for the create_label tool using Zod.
    {
        name: z.string().describe("Name of the label"),
        color: z.enum(["gray", "red", "orange", "yellow", "green", "blue", "purple", "pink"]).optional().default("gray").describe("Label color"),
    },
  • src/index.ts:317-346 (registration)
    Registration of the create_label tool using server.tool.
    server.tool(
        "create_label",
        {
            name: z.string().describe("Name of the label"),
            color: z.enum(["gray", "red", "orange", "yellow", "green", "blue", "purple", "pink"]).optional().default("gray").describe("Label color"),
        },
        async ({ name, color }) => {
            try {
                const data = await apiRequest("/api/labels", {
                    method: "POST",
                    body: JSON.stringify({ name, color }),
                });
    
                return {
                    content: [{
                        type: "text",
                        text: `Label created successfully!\nID: ${data.label.id}\nName: ${data.label.name}\nColor: ${data.label.color}`
                    }]
                };
            } catch (error) {
                return {
                    content: [{
                        type: "text",
                        text: `Error creating label: ${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