Skip to main content
Glama

Simple TypeScript MCP Server

by jasonkneen

getAllNotes

Retrieve all stored notes in JSON format using the Simple TypeScript MCP Server, enabling efficient access and management of note data.

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": {}, "type": "object" }

Implementation Reference

  • MCP tool handler for getAllNotes: retrieves all notes from notesStore, formats as JSON success response, or error response on failure.
    async () => { try { const notesList = notesStore.getAllNotes(); return { content: [ { type: "text", text: JSON.stringify({ success: true, notes: notesList }, null, 2) } ] }; } catch (err) { return { content: [ { type: "text", text: JSON.stringify({ success: false, error: "Failed to retrieve notes" }, null, 2) } ] }; } },
  • Type definition for Note objects returned by getAllNotes.
    export interface Note { id: string; title: string; content: string; createdAt: string; }
  • src/server.ts:66-98 (registration)
    Full registration of the getAllNotes tool on the MCP server, specifying the tool name, empty input schema, and handler function.
    server.tool( "getAllNotes", {}, async () => { try { const notesList = notesStore.getAllNotes(); return { content: [ { type: "text", text: JSON.stringify({ success: true, notes: notesList }, null, 2) } ] }; } catch (err) { return { content: [ { type: "text", text: JSON.stringify({ success: false, error: "Failed to retrieve notes" }, null, 2) } ] }; } }, );
  • Core helper method in NotesStore class that implements the logic to retrieve all notes.
    getAllNotes(): Note[] { return Object.values(this.notes); }
  • Singleton instance of NotesStore used by the tool handler.
    export const notesStore = new NotesStore();

Other Tools

Related Tools

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/jasonkneen/mcp-server-ts'

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