get_note_content
Retrieve the full content and metadata of a specific note by its path within an Obsidian vault, enabling efficient data access and analysis for AI-driven workflows.
Instructions
Get the full content and metadata of a specific note by path.
Args:
path: Full path to the note within the vault
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes |
Implementation Reference
- src/obsidian_mcp/server.py:107-125 (handler)The main handler function for the 'get_note_content' tool. It retrieves the note's metadata and content by calling the Obsidian client's get_note_metadata method, handling success and error cases.async def get_note_content(path: str) -> Dict[str, Any]: """ Get the full content and metadata of a specific note by path. Args: path: Full path to the note within the vault """ try: note_data = await client.get_note_metadata(path) return { "success": True, "data": note_data } except Exception as e: return { "success": False, "error": f"Failed to get note at path '{path}': {str(e)}", "data": None }
- src/obsidian_mcp/server.py:100-106 (registration)Registers the 'get_note_content' tool with the FastMCP server, providing metadata annotations like title and read-only hints.@mcp.tool( annotations={ "title": "Get Obsidian Note Content", "readOnlyHint": True, "openWorldHint": False } )
- src/obsidian_mcp/client.py:34-40 (helper)Helper method in ObsidianClient that performs the HTTP GET request to fetch note metadata from the Obsidian API.async def get_note_metadata(self, path: str) -> Dict[str, Any]: encoded_path = quote(path, safe='/') return await self._request( "GET", f"/vault/{encoded_path}", headers={"Accept": "application/vnd.olrapi.note+json"} )