Skip to main content
Glama
list-notes.ts854 B
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { NotesCache } from "../cache"; export function registerListNotesTool(server: McpServer, cache: NotesCache): void { server.tool("list_notes", "列出所有笔记", async () => { const items = cache.getNotesListItems(); if (items.length === 0) { return { content: [ { type: "text" as const, text: "暂无笔记。", }, ], }; } const lines = items .map((item, index) => { const modifyDate = new Date(item.modifyDate).toISOString(); return `${index + 1}. [${item.id}] ${item.title} (${modifyDate})`; }) .join("\n"); return { content: [ { type: "text" as const, text: lines, }, ], }; }); }

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/LaelLuo/mi_note_mcp'

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