Skip to main content
Glama
Myk3rinos

MCP Personal Tools Server

by Myk3rinos

add-note

Add a new line to your notes file through the MCP Personal Tools Server. Enter text to store and organize personal notes efficiently.

Instructions

Ajoute une nouvelle ligne au fichier de notes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesLe texte à ajouter au fichier de notes

Implementation Reference

  • The main handler function for the 'add-note' tool. It creates the notes directory if needed, appends a timestamped text entry to note.txt in ~/Documents/notes/, and returns a success or error message in MCP content format.
    }, async ({ text }) => { try { const notesDir = path.join(userHomeDir, 'Documents', 'notes'); // Create the directory if it doesn't exist await fs.mkdir(notesDir, { recursive: true }); // Add the new line to the file await fs.appendFile(path.join(notesDir, 'note.txt'), `${new Date().toISOString()} - ${text}\n`); return { content: [{ type: "text", text: `${text},Note added successfully` }] }; } catch (error) { console.error("Error while adding the note:", error); return { content: [{ type: "text", text: `Error while adding the note` }] }; }
  • Zod input schema for the 'add-note' tool, defining a required 'text' string parameter.
    text: z.string().describe("The text to add to the notes file"),
  • src/server.ts:89-114 (registration)
    Registration of the 'add-note' tool on the MCP server, including description, input schema, metadata hints, and inline handler function.
    server.tool("add-note", "Add a new line to the notes file", { text: z.string().describe("The text to add to the notes file"), }, { title: "Add Note", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true, }, async ({ text }) => { try { const notesDir = path.join(userHomeDir, 'Documents', 'notes'); // Create the directory if it doesn't exist await fs.mkdir(notesDir, { recursive: true }); // Add the new line to the file await fs.appendFile(path.join(notesDir, 'note.txt'), `${new Date().toISOString()} - ${text}\n`); return { content: [{ type: "text", text: `${text},Note added successfully` }] }; } catch (error) { console.error("Error while adding the note:", error); return { content: [{ type: "text", text: `Error while adding the note` }] }; } })

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/Myk3rinos/MCP'

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