create_note
Generate a micro-note with customizable privacy settings (public or private) to store concise information efficiently. Integrates with Emlog MCP Server for streamlined content management.
Instructions
Create a new micro-note
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| private | No | Whether the note is private (y) or public (n) | |
| t | Yes | The content of the micro-note |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"private": {
"description": "Whether the note is private (y) or public (n)",
"enum": [
"y",
"n"
],
"type": "string"
},
"t": {
"description": "The content of the micro-note",
"type": "string"
}
},
"required": [
"t"
],
"type": "object"
}
Implementation Reference
- src/index.ts:492-510 (handler)MCP tool handler for 'create_note': calls emlogClient.publishNote with input parameters and returns a formatted success or error message.async ({ t, private: isPrivate }) => { try { await emlogClient.publishNote(t, isPrivate); return { content: [{ type: "text", text: `Successfully created micro-note: ${t.substring(0, 50)}${t.length > 50 ? '...' : ''}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } }
- src/index.ts:487-490 (schema)Zod input schema defining parameters 't' (note content) and optional 'private' flag for the create_note tool.inputSchema: { t: z.string().describe("The content of the micro-note"), private: z.enum(["y", "n"]).optional().describe("Whether the note is private (y) or public (n)") }
- src/index.ts:482-511 (registration)Registration of the 'create_note' tool using server.registerTool, including schema and inline handler function.server.registerTool( "create_note", { title: "Create Note", description: "Create a new micro-note", inputSchema: { t: z.string().describe("The content of the micro-note"), private: z.enum(["y", "n"]).optional().describe("Whether the note is private (y) or public (n)") } }, async ({ t, private: isPrivate }) => { try { await emlogClient.publishNote(t, isPrivate); return { content: [{ type: "text", text: `Successfully created micro-note: ${t.substring(0, 50)}${t.length > 50 ? '...' : ''}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );
- src/emlog-client.ts:386-394 (helper)EmlogClient.publishNote method: constructs form data with note content and privacy flag, posts to Emlog API endpoint /?rest-api=note_post to create the note.async publishNote(content: string, isPrivate?: string): Promise<{ note_id: number }> { const note = { t: content, private: isPrivate || 'n' }; const formData = this.buildFormData(note); const response = await this.api.post('/?rest-api=note_post', formData); return response.data.data; }