Skip to main content
Glama

get_note

Retrieve the full content of a specific note from a personal knowledge base using its category path and title.

Instructions

Retrieve the full content of a specific note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
category_pathYesCategory path (e.g., 'work/clients/acme')
titleYesNote title (can use full filename or friendly title)

Implementation Reference

  • The MCP tool handler function that executes the get_note tool logic. It extracts arguments, retrieves the note using storage.get_note, formats the output with metadata, and returns it as TextContent.
    async def handle_get_note(arguments: dict) -> list[TextContent]: """Handle get_note tool call.""" try: category_path = arguments["category_path"] title = arguments["title"] # Get note note = storage.get_note(category_path, title) # Format output with frontmatter output = f"# {note.title}\n\n" output += f"**Category:** {note.category or 'root'}\n" output += f"**Tags:** {', '.join(note.frontmatter.tags) if note.frontmatter.tags else 'none'}\n" output += f"**Date:** {note.frontmatter.date}\n" if note.frontmatter.updated: output += f"**Updated:** {note.frontmatter.updated}\n" # Add metadata if any if note.frontmatter.metadata: output += "\n**Additional Info:**\n" for key, value in note.frontmatter.metadata.items(): output += f"- {key}: {value}\n" output += f"\n---\n\n{note.content}" return [TextContent(type="text", text=output)] except (NoteNotFoundError, StorageError) as e: return [TextContent(type="text", text=str(e))] except Exception as e: return [TextContent(type="text", text=f"❌ Error: {str(e)}")]
  • Registration of the 'get_note' tool in the list_tools() function, including name, description, and input schema.
    Tool( name="get_note", description="Retrieve the full content of a specific note", inputSchema={ "type": "object", "properties": { "category_path": { "type": "string", "description": "Category path (e.g., 'work/clients/acme')", }, "title": { "type": "string", "description": "Note title (can use full filename or friendly title)", }, }, "required": ["category_path", "title"], }, ),
  • Core helper method in KnowledgeBaseStorage that retrieves and parses the note file from disk based on category and title.
    def get_note(self, category_path: str, title: str) -> Note: """ Retrieve a note by category path and title. Args: category_path: Category path (e.g., "work/clients/acme") title: Note title (can be friendly name or filename) Returns: Note object Raises: NoteNotFoundError: If note doesn't exist """ normalized = normalize_path(category_path) file_path = self._get_note_path(normalized, title) if not file_path.exists(): raise NoteNotFoundError( f"❌ Error: Note '{title}' not found in {normalized or 'root'}/\n" f"💡 Tip: Use search_notes to find existing notes" ) return self._parse_note_file(file_path)

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/cwente25/KnowledgeBaseMCP'

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