Skip to main content
Glama

listNotes

Search and list all notes or filter them by specific tags to quickly find relevant information in your MCP Notes server.

Instructions

Lists all notes, or search notes with tags you seen in previous list operation.

Input Schema

NameRequiredDescriptionDefault
tagsNoOptional tags to filter notes. do not specify this if you didn't certainly sure what tags you want.

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "tags": { "description": "Optional tags to filter notes. do not specify this if you didn't certainly sure what tags you want.", "items": { "type": "string" }, "type": "array" } }, "type": "object" }

Implementation Reference

  • The core handler function for the 'listNotes' tool. It performs a ScanCommand on the DynamoDB table, optionally filters by tags, simplifies the note data, updates the global ALL_RESOURCES list with note resources, and returns a formatted content response with note count and JSON list.
    export const handleListNotes = async ( docClient: DynamoDBDocumentClient, tableName: string, ALL_RESOURCES: Resource[], tags?: string[] ) => { const scanParams: any = { TableName: tableName }; if (tags && tags.length > 0) { scanParams.FilterExpression = "tags IN (:tags)"; scanParams.ExpressionAttributeValues = { ":tags": tags, }; } const command = new ScanCommand(scanParams); const response = await docClient.send(command); const notes = (response.Items as Note[]) || []; const simplifiedNotes = notes.map((note) => ({ id: note.id, title: note.title, summary: note.summary, tags: note.tags, })); ALL_RESOURCES.length = 0; notes.forEach((note) => { ALL_RESOURCES.push({ uri: `notes://notes/${note.id}`, name: note.title, mimeType: "application/json", text: JSON.stringify(note), }); }); return { content: [ { type: "text", text: `Found ${notes.length} notes.` }, { type: "text", text: JSON.stringify(simplifiedNotes) }, ], }; };
  • Zod input schema for the listNotes tool, defining an optional array of tags for filtering notes.
    export const ListNotesInputSchema = z.object({ tags: z .array(z.string()) .optional() .describe("Optional tags to filter notes. do not specify this if you didn't certainly sure what tags you want."), });
  • Tool registration in getTools() function, which returns the list of available tools including 'listNotes' with its name, description, and converted JSON input schema. This is used by the listTools handler.
    export const getTools = (): Tool[] => [ { name: ToolName.LIST_NOTES, description: "Lists all notes, or search notes with tags you seen in previous list operation.", inputSchema: zodToJsonSchema(ListNotesInputSchema) as Tool["inputSchema"], },
  • Tool dispatch/execution routing in the CallToolRequestSchema handler's switch statement. Parses input with schema and calls the handleListNotes function.
    case ToolName.LIST_NOTES: { const { tags } = ListNotesInputSchema.parse(args); return handleListNotes(docClient, tableName, ALL_RESOURCES, tags); }
  • Enum definition for the tool name constant ToolName.LIST_NOTES = "listNotes".
    LIST_NOTES = "listNotes",

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/9Ninety/MCPNotes'

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