Skip to main content
Glama

ToolBox MCP Server

ResourceHandler.ts860 B
import { notes } from "../tools/create_note.js"; /** 所有资源列表 */ export const listResourcesHandler = async () => { return { resources: Object.entries(notes).map(([id, note]) => ({ uri: `note:///${id}`, mimeType: "text/plain", name: note.title, description: `A text note: ${note.title}` })) }; }; /** 读取某个资源 */ export const readResourceHandler = async (request: any) => { const url = new URL(request.params.uri); const id = url.pathname.replace(/^\//, ""); const note = notes[id]; if (!note) { throw new Error(`Note ${id} not found`); } return { contents: [ { uri: request.params.uri, mimeType: "text/plain", text: note.content, }, ], }; };

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/xiaoguomeiyitian/ToolBox'

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