Skip to main content
Glama
dot-RealityTest

obsidian-codex-mcp

search_notes

Search notes by content, title, or tags, optionally within a specific folder.

Instructions

Search notes by content, title, or tags.

Args: query: Search query string folder: Optional folder to search within

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
folderNo

Implementation Reference

  • server.py:200-201 (registration)
    The MCP tool registration decorator marking 'search_notes' as a callable tool on the FastMCP server.
    @mcp.tool()
    def search_notes(query: str, folder: Optional[str] = None) -> list:
  • The handler function for the 'search_notes' tool. It obtains the vault client, delegates the search to client.search_notes(), and formats results with path, title, and a 200-char excerpt.
    def search_notes(query: str, folder: Optional[str] = None) -> list:
        """Search notes by content, title, or tags.
        
        Args:
            query: Search query string
            folder: Optional folder to search within
        """
        try:
            client = get_vault_client()
            results = client.search_notes(query, folder)
            
            return [
                {
                    "path": note['path'],
                    "title": note['title'],
                    "excerpt": note['content'][:200] + "..." if len(note['content']) > 200 else note['content']
                }
                for note in results
            ]
        except Exception as e:
            return [{"error": str(e)}]
  • The underlying helper method on ObsidianVaultClient that performs the actual search, filtering notes by title, content, and tags (case-insensitive).
    def search_notes(self, query: str, folder: Optional[str] = None) -> List[Dict[str, Any]]:
        """Search notes by content or title."""
        notes = self.list_notes(folder)
        results = []
        
        query_lower = query.lower()
        for note in notes:
            if (query_lower in note['title'].lower() or 
                query_lower in note['content'].lower() or
                query_lower in ' '.join(str(tag) for tag in note.get('tags', [])).lower()):
                results.append(note)
        
        return results
  • Type signature indicating the tool accepts 'query: str' (required) and 'folder: Optional[str]' (optional), returning a list.
    def search_notes(query: str, folder: Optional[str] = None) -> list:
Behavior2/5

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

No annotations exist, so the description must fully convey behavior. It only mentions search dimensions without details on pagination, wildcards, or whether it's destructive, which is insufficient.

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

Conciseness4/5

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

The description is short and front-loaded with the main purpose, but the Args section could be integrated more naturally. It remains efficient.

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 low parameter count and no output schema, the description is minimally adequate for a search tool. However, it omits any mention of return format or behavior, which could mislead.

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?

With 0% schema description coverage, the description adds meaning by labeling 'query' as 'Search query string' and 'folder' as 'Optional folder to search within', improving over bare schema.

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 verb 'search' and resource 'notes', and specifies search dimensions (content, title, tags). This distinguishes it from siblings like list_notes and get_note.

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

Usage Guidelines3/5

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

The description implies usage for text-based note searching but does not explicitly state when to use this tool versus others, nor does it provide exclusion criteria or alternatives.

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/dot-RealityTest/obsidian-codex-mcp'

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