getNote
Retrieve specific notes by their unique ID using this tool, designed to simplify access to recorded information on the MCP Notes server for efficient note management.
Instructions
Retrieves a specific note by its ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the note to retrieve |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"id": {
"description": "ID of the note to retrieve",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- src/notes-mcp-server/handlers.ts:55-74 (handler)The handler function that implements the core logic of the getNote tool: retrieves a note from DynamoDB using GetCommand by ID and returns MCP-formatted content (JSON stringified note or not found message).export const handleGetNote = async ( docClient: DynamoDBDocumentClient, tableName: string, id: string ) => { const command = new GetCommand({ TableName: tableName, Key: { id } }); const response = await docClient.send(command); const note = response.Item as Note; return note ? { content: [ { type: "text", text: `Note found with ID '${id}':` }, { type: "text", text: JSON.stringify(note) }, ], } : { content: [{ type: "text", text: `Note with ID '${id}' not found.` }], }; };
- Zod input schema for the getNote tool, validating a single 'id' string parameter.export const GetNoteInputSchema = z.object({ id: z.string().describe("ID of the note to retrieve"), });
- src/notes-mcp-server/tools.ts:18-22 (registration)Tool object registration for getNote in the MCP tools list returned by getTools(), used for listTools handler. Converts Zod schema to JSON schema.{ name: ToolName.GET_NOTE, description: "Retrieves a specific note by its ID.", inputSchema: zodToJsonSchema(GetNoteInputSchema) as Tool["inputSchema"], },
- src/notes-mcp-server/server.ts:132-135 (registration)Dispatch/registration in the CallToolRequest handler switch statement: parses input with schema and invokes the getNote handler.case ToolName.GET_NOTE: { const { id: getNoteId } = GetNoteInputSchema.parse(args); return handleGetNote(docClient, tableName, getNoteId); }
- src/notes-mcp-server/types.ts:3-3 (helper)Enum value defining the tool name constant ToolName.GET_NOTE = 'getNote'.GET_NOTE = "getNote",