Skip to main content
Glama
folders-list.ts995 B
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { NotesCache } from "../cache"; export function registerFoldersListResource(server: McpServer, cache: NotesCache): void { server.registerResource( "folders", "minote://folders", { title: "文件夹列表", description: "返回所有文件夹的基本信息", mimeType: "text/plain", }, async () => { const folders = cache .getFolders() .sort((a, b) => b.modifyDate - a.modifyDate); const lines = folders.map((folder, index) => { const modified = new Date(folder.modifyDate).toISOString(); const subject = folder.subject || "(未命名)"; return `${index + 1}. [${folder.id}] ${subject} (${modified})`; }); return { contents: [ { uri: "minote://folders", text: lines.length > 0 ? lines.join("\n") : "暂无文件夹", }, ], }; }, ); }

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