capacities_save_to_daily_note
Add markdown content to today's daily note in your Capacities knowledge management space. Organize information by saving text directly to the current date's note.
Instructions
Add markdown text to today's daily note in a Capacities space
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spaceId | Yes | The UUID of the space to save to the daily note | |
| mdText | Yes | The markdown text to add to today's daily note | |
| origin | No | Optional origin label for the content (only 'commandPalette' is supported) | |
| noTimestamp | No | If true, no time stamp will be added to the note |
Implementation Reference
- src/tools/saveToDailyNote.ts:11-48 (handler)The execute function implementing the tool logic: constructs a request body from args and POSTs to /save-to-daily-note API endpoint, handles response or error.execute: async (args: { spaceId: string; mdText: string; origin?: "commandPalette"; noTimestamp?: boolean; }) => { try { const requestBody = { spaceId: args.spaceId, mdText: args.mdText, ...(args.origin && { origin: args.origin }), ...(args.noTimestamp !== undefined && { noTimestamp: args.noTimestamp, }), }; const response = await makeApiRequest("/save-to-daily-note", { method: "POST", body: JSON.stringify(requestBody), }); // Check if response has content before parsing JSON const responseText = await response.text(); if (!responseText.trim()) { return "Success: Content saved to daily note (no response data)"; } try { const data = JSON.parse(responseText); return JSON.stringify(data, null, 2); } catch (parseError) { return `Success: Content saved to daily note. Response: ${responseText}`; } } catch (error) { throw new Error( `Failed to save to daily note: ${error instanceof Error ? error.message : String(error)}`, ); }
- src/tools/saveToDailyNote.ts:51-70 (schema)Zod schema defining the input parameters for the tool: spaceId (UUID), mdText (string max 200k), optional origin and noTimestamp.parameters: z.object({ spaceId: z .string() .uuid() .describe("The UUID of the space to save to the daily note"), mdText: z .string() .max(200000) .describe("The markdown text to add to today's daily note"), origin: z .enum(["commandPalette"]) .optional() .describe( "Optional origin label for the content (only 'commandPalette' is supported)", ), noTimestamp: z .boolean() .optional() .describe("If true, no time stamp will be added to the note"), }),
- src/server.ts:30-30 (registration)Registration of the tool with the FastMCP server instance.server.addTool(saveToDailyNoteTool);