Skip to main content
Glama

get_orphaned_notes

Identify notes that have no incoming or outgoing links to help users find unconnected content in their Obsidian vault for better organization.

Instructions

Find notes with no incoming or outgoing links

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core implementation of get_orphaned_notes: iterates over all notes, checks for outgoing links using _extract_links and incoming backlinks using get_backlinks, collects paths of notes with neither.
    async def get_orphaned_notes(self) -> list[str]:
        """
        Get notes with no incoming or outgoing links.
    
        Returns:
            List of orphaned note paths
        """
        orphans = []
    
        for note_meta in self.list_notes(limit=10000):
            try:
                # Check outgoing links
                note = await self.read_note(note_meta.path)
                outgoing = self._extract_links(note.content)
    
                # Check backlinks (simplified - just check if mentioned anywhere)
                backlinks = await self.get_backlinks(note_meta.path)
    
                if not outgoing and not backlinks:
                    orphans.append(note_meta.path)
            except Exception as e:
                logger.debug(f"Error checking orphan status for {note_meta.path}: {e}")
                continue
    
        return orphans
  • MCP tool registration using @mcp.tool decorator. Thin wrapper around vault.get_orphaned_notes(), adds optional limit parameter, input validation, error handling, and formats the output as a numbered list.
        name="get_orphaned_notes",
        description="Find notes with no incoming or outgoing links",
    )
    async def get_orphaned_notes(limit: int = 50) -> str:
        """
        Get notes with no incoming or outgoing links.
    
        Args:
            limit: Maximum number of results (default: 50)
    
        Returns:
            Formatted list of orphaned notes
        """
        if limit <= 0 or limit > 1000:
            return "Error: Limit must be between 1 and 1000"
    
        context = _get_context()
    
        try:
            orphans = await context.vault.get_orphaned_notes()
    
            if not orphans:
                return "No orphaned notes found (all notes are connected!)"
    
            # Limit results
            orphans = orphans[:limit]
    
            output = f"Found {len(orphans)} orphaned note(s) (showing first {len(orphans)}):\n\n"
            for i, path in enumerate(orphans, 1):
                output += f"{i}. `{path}`\n"
    
            return output
    
        except Exception as e:
            logger.exception("Error finding orphaned notes")
            return f"Error finding orphaned notes: {e}"
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but omits critical details such as whether this is a read-only operation, how results are ordered, if pagination is supported, or what happens when limit is exceeded. For a tool with output schema, some behavior is implied, but key operational traits are missing.

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 wasted words. It is front-loaded with the core purpose and avoids unnecessary elaboration, making it easy for an agent to parse quickly. Every word earns its place by directly contributing to understanding the tool's function.

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 moderate complexity (finding orphaned notes), no annotations, and an output schema that likely covers return values, the description is minimally adequate. It states the purpose clearly but lacks context on behavior, usage scenarios, or limitations. The presence of an output schema reduces the need to explain returns, but more operational guidance would improve completeness.

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

Parameters4/5

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

The description adds no parameter information beyond the input schema, which has 0% description coverage. However, with only one parameter (limit) and a default value of 50, the schema is minimal and self-explanatory. The description does not need to compensate heavily, but it could have clarified the limit's effect (e.g., on performance or result truncation). Baseline is 4 due to low parameter complexity.

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

Purpose5/5

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

The description clearly states the specific action ('Find') and target resource ('notes with no incoming or outgoing links'), which distinguishes it from sibling tools like get_backlinks, get_outgoing_links, or get_related_notes that focus on linked notes. It precisely defines the scope of orphaned notes without ambiguity.

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 like list_notes, search_notes, or get_notes_by_tag. It does not mention prerequisites, exclusions, or typical use cases, leaving the agent to infer usage context from the tool name alone.

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