Skip to main content
Glama

list_templates

Browse available note templates to quickly create structured documents in your Obsidian vault. Select from pre-designed formats for consistent note-taking and organization.

Instructions

List available note templates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderNoTemplates

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core implementation of list_templates in the ObsidianVault class that lists notes recursively in the specified folder (default Templates), returning NoteMetadata list or empty on folder not found. The handler in server.py calls this method.
    def list_templates(self, folder: str = "Templates") -> list[NoteMetadata]:
        """
        List available templates.
    
        Args:
            folder: Folder where templates are stored
    
        Returns:
            List of template notes
        """
        try:
            return self.list_notes(folder=folder, recursive=True, limit=None)
        except FileNotFoundError:
            return []
    
    async def create_from_template(
        self,
        template_path: str,
        new_note_path: str,
        replacements: dict[str, str] | None = None,
    ) -> None:
        """
        Create a new note from a template.
    
        Args:
            template_path: Path to the template note
            new_note_path: Path for the new note
            replacements: Dict of placeholder -> value replacements
    
        Raises:
            FileNotFoundError: If template doesn't exist
        """
        # Read template
        template = await self.read_note(template_path)
    
        content = template.content
        frontmatter = template.frontmatter.copy() if template.frontmatter else None
    
        # Apply replacements
        if replacements:
            for placeholder, value in replacements.items():
                content = content.replace(f"{{{{{placeholder}}}}}", value)
    
                # Also replace in frontmatter values
                if frontmatter:
                    for key, fm_value in frontmatter.items():
                        if isinstance(fm_value, str):
                            frontmatter[key] = fm_value.replace(f"{{{{{placeholder}}}}}", value)
    
        # Create new note
        self.create_note(new_note_path, content, frontmatter)
    
    async def get_link_graph(self, max_notes: int = 1000) -> dict[str, Any]:
        """
        Build a link graph for the vault.
    
        Returns:
            Dict with 'nodes' and 'edges' for visualization
        """
        nodes = []
        edges = []
        seen_paths = set()
    
        for note_meta in self.list_notes(limit=max_notes):
            # Add node
            if note_meta.path not in seen_paths:
                nodes.append(
                    {
                        "id": note_meta.path,
                        "name": note_meta.name,
                        "size": note_meta.size,
                        "tags": note_meta.tags if note_meta.tags else [],
                    }
                )
                seen_paths.add(note_meta.path)
    
            # Add edges (links)
            try:
                note = await self.read_note(note_meta.path)
                links = self._extract_links(note.content)
    
                for link in links:
                    resolved = self._resolve_link(link, note_meta.path)
                    if resolved and resolved in seen_paths:
                        edges.append(
                            {
                                "source": note_meta.path,
                                "target": resolved,
                            }
                        )
            except Exception as e:
                logger.debug(f"Error building graph for {note_meta.path}: {e}")
                continue
    
        return {
            "nodes": nodes,
            "edges": edges,
            "total_nodes": len(nodes),
            "total_edges": len(edges),
        }
    
    async def get_related_notes(
        self, relative_path: str, limit: int = 10
    ) -> list[tuple[str, float]]:
        """
        Find notes related to a given note.
    
        Uses shared links and tags to calculate similarity.
    
        Args:
            relative_path: Path to the note
            limit: Maximum number of related notes
    
        Returns:
            List of (note_path, similarity_score) tuples
        """
        target_note = await self.read_note(relative_path)
    
        # Get target note's links and tags
        target_links = set(self._extract_links(target_note.content))
        target_tags = set(self._extract_tags(target_note.content, target_note.frontmatter))
    
        related: list[tuple[str, float]] = []
    
        for note_meta in self.list_notes(limit=1000, include_tags=True):
            # Skip the target note itself
            if note_meta.path == relative_path:
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 for behavioral disclosure. It states it 'lists' templates, implying a read-only operation, but doesn't cover critical aspects like whether it requires authentication, returns paginated results, includes metadata (e.g., template names or descriptions), or how it interacts with the 'folder' parameter. For a tool with no annotation coverage, this is a significant gap.

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 with zero waste: 'List available note templates'. It's front-loaded with the core action and resource, making it easy to parse quickly without unnecessary elaboration.

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

Completeness3/5

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

Given the tool's low complexity (one optional parameter) and the presence of an output schema (which handles return values), the description is minimally adequate. However, with no annotations and incomplete parameter guidance, it lacks context on behavioral traits and usage scenarios, making it just sufficient but with clear gaps.

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?

The description adds no parameter information beyond what the input schema provides. With 0% schema description coverage and one parameter ('folder'), the schema alone defines it as a string with default 'Templates'. The description doesn't explain what 'folder' means (e.g., a directory path, a category) or its effect, so it doesn't compensate for the low coverage, resulting in a baseline score.

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 'List available note templates' clearly states the action (list) and resource (note templates), making the purpose immediately understandable. However, it doesn't distinguish this tool from other list-like siblings such as 'list_notes', 'list_all_tags', or 'list_calendar_events', which would require specifying what makes templates unique (e.g., predefined note structures).

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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'list_notes' and 'create_from_template', there's no indication whether this is for browsing templates before creation, checking what's available, or other contexts. The lack of when/when-not statements leaves usage ambiguous.

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/getglad/obsidian_mcp'

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