Skip to main content
Glama
MarkusPfundstein

MCP server for Obsidian

obsidian_get_recent_periodic_notes

Retrieve recent periodic notes (daily, weekly, monthly, quarterly, yearly) from Obsidian vault to track progress and review time-based entries.

Instructions

Get most recent periodic notes for the specified period type.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodYesThe period type (daily, weekly, monthly, quarterly, yearly)
limitNoMaximum number of notes to return (default: 5)
include_contentNoWhether to include note content (default: false)

Implementation Reference

  • The `run_tool` method in `RecentPeriodicNotesToolHandler` class implements the tool logic: validates input parameters (period, limit, include_content), instantiates Obsidian API client, calls `api.get_recent_periodic_notes`, and returns JSON-formatted results.
    def run_tool(self, args: dict) -> Sequence[TextContent | ImageContent | EmbeddedResource]:
        if "period" not in args:
            raise RuntimeError("period argument missing in arguments")
    
        period = args["period"]
        valid_periods = ["daily", "weekly", "monthly", "quarterly", "yearly"]
        if period not in valid_periods:
            raise RuntimeError(f"Invalid period: {period}. Must be one of: {', '.join(valid_periods)}")
    
        limit = args.get("limit", 5)
        if not isinstance(limit, int) or limit < 1:
            raise RuntimeError(f"Invalid limit: {limit}. Must be a positive integer")
            
        include_content = args.get("include_content", False)
        if not isinstance(include_content, bool):
            raise RuntimeError(f"Invalid include_content: {include_content}. Must be a boolean")
    
        api = obsidian.Obsidian(api_key=api_key, host=obsidian_host)
        results = api.get_recent_periodic_notes(period, limit, include_content)
    
        return [
            TextContent(
                type="text",
                text=json.dumps(results, indent=2)
            )
        ]
  • The `get_tool_description` method defines the tool's metadata including name, description, and input schema (JSON Schema) for parameters: period (required, enum), limit (optional, 1-50), include_content (optional boolean).
    def get_tool_description(self):
        return Tool(
            name=self.name,
            description="Get most recent periodic notes for the specified period type.",
            inputSchema={
                "type": "object",
                "properties": {
                    "period": {
                        "type": "string",
                        "description": "The period type (daily, weekly, monthly, quarterly, yearly)",
                        "enum": ["daily", "weekly", "monthly", "quarterly", "yearly"]
                    },
                    "limit": {
                        "type": "integer",
                        "description": "Maximum number of notes to return (default: 5)",
                        "default": 5,
                        "minimum": 1,
                        "maximum": 50
                    },
                    "include_content": {
                        "type": "boolean",
                        "description": "Whether to include note content (default: false)",
                        "default": False
                    }
                },
                "required": ["period"]
            }
        )
  • The tool handlers are registered in a dictionary via `add_tool_handler(tools.RecentPeriodicNotesToolHandler())` at line 55, which uses the tool name from the handler's __init__. The `list_tools` and `call_tool` methods use this registry.
    tool_handlers = {}
    def add_tool_handler(tool_class: tools.ToolHandler):
        global tool_handlers
    
        tool_handlers[tool_class.name] = tool_class
    
    def get_tool_handler(name: str) -> tools.ToolHandler | None:
        if name not in tool_handlers:
            return None
        
        return tool_handlers[name]
    
    add_tool_handler(tools.ListFilesInDirToolHandler())
    add_tool_handler(tools.ListFilesInVaultToolHandler())
    add_tool_handler(tools.GetFileContentsToolHandler())
    add_tool_handler(tools.SearchToolHandler())
    add_tool_handler(tools.PatchContentToolHandler())
    add_tool_handler(tools.AppendContentToolHandler())
    add_tool_handler(tools.PutContentToolHandler())
    add_tool_handler(tools.DeleteFileToolHandler())
    add_tool_handler(tools.ComplexSearchToolHandler())
    add_tool_handler(tools.BatchGetFileContentsToolHandler())
    add_tool_handler(tools.PeriodicNotesToolHandler())
    add_tool_handler(tools.RecentPeriodicNotesToolHandler())
    add_tool_handler(tools.RecentChangesToolHandler())
  • The `Obsidian` class method `get_recent_periodic_notes` makes an HTTP GET request to the Obsidian API endpoint `/periodic/{period}/recent` with limit and includeContent params, handles errors, and returns JSON response. Called by the tool handler.
    def get_recent_periodic_notes(self, period: str, limit: int = 5, include_content: bool = False) -> Any:
        """Get most recent periodic notes for the specified period type.
        
        Args:
            period: The period type (daily, weekly, monthly, quarterly, yearly)
            limit: Maximum number of notes to return (default: 5)
            include_content: Whether to include note content (default: False)
            
        Returns:
            List of recent periodic notes
        """
        url = f"{self.get_base_url()}/periodic/{period}/recent"
        params = {
            "limit": limit,
            "includeContent": include_content
        }
        
        def call_fn():
            response = requests.get(
                url, 
                headers=self._get_headers(), 
                params=params,
                verify=self.verify_ssl, 
                timeout=self.timeout
            )
            response.raise_for_status()
            
            return response.json()
    
        return self._safe_call(call_fn)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool retrieves notes but doesn't disclose behavioral traits like whether it returns metadata only (unless include_content=true), how 'most recent' is determined (e.g., by creation or modification date), pagination, error handling, or rate limits. The description is minimal and lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. It wastes no words and is appropriately sized for the tool's complexity. Every part of the sentence contributes to understanding the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It doesn't explain what 'most recent' means, the return format (e.g., list of notes with metadata), or how results are ordered. For a tool with 3 parameters and no structured output documentation, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear descriptions for all parameters (period, limit, include_content). The description adds no additional parameter semantics beyond what the schema provides, such as explaining period types further or content inclusion implications. Baseline 3 is appropriate as the schema adequately documents parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get most recent') and resource ('periodic notes'), specifying the scope ('for the specified period type'). It distinguishes from siblings like 'obsidian_get_periodic_note' (singular) and 'obsidian_get_recent_changes' (general changes), but doesn't explicitly contrast them. Purpose is clear but sibling differentiation is implicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives. The description implies usage for retrieving recent periodic notes, but doesn't mention when to choose it over 'obsidian_get_periodic_note' (likely for a specific note) or 'obsidian_get_recent_changes' (for all recent changes). No prerequisites or exclusions are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/MarkusPfundstein/mcp-obsidian'

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