Skip to main content
Glama
j-shelfwood

Obsidian Local REST API MCP Server

by j-shelfwood

search_vault

Search across Obsidian vault content, filenames, and metadata using queries with scope filtering and path restrictions.

Instructions

Search vault content across files, filenames, and metadata with advanced filtering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
scopeNoSearch scope - where to look for the query
path_filterNoLimit search to specific path prefix

Implementation Reference

  • Core implementation of the search_vault tool in ObsidianApiClient class. Constructs query parameters and calls the REST API endpoint `/vault/search`.
    async searchVault(query: string, scope: string[] = ["content", "filename", "tags"], pathFilter?: string) {
      const params = new URLSearchParams({
        query,
        scope: scope.join(","),
      });
      if (pathFilter) {
        params.append("path_filter", pathFilter);
      }
      return this.request(`/vault/search?${params}`);
  • Input schema for the search_vault tool, defining the expected parameters: query (required), scope (array with enum), and optional path_filter.
    inputSchema: {
      type: "object",
      properties: {
        query: { type: "string", description: "Search query" },
        scope: {
          type: "array",
          items: { type: "string", enum: ["content", "filename", "tags"] },
          description: "Search scope - where to look for the query",
          default: ["content", "filename", "tags"]
        },
        path_filter: { type: "string", description: "Limit search to specific path prefix" },
      },
      required: ["query"],
    },
  • src/index.ts:362-379 (registration)
    Registration of the search_vault tool in the ListTools response, including name, description, and input schema.
    {
      name: "search_vault",
      description: "Search vault content across files, filenames, and metadata with advanced filtering",
      inputSchema: {
        type: "object",
        properties: {
          query: { type: "string", description: "Search query" },
          scope: {
            type: "array",
            items: { type: "string", enum: ["content", "filename", "tags"] },
            description: "Search scope - where to look for the query",
            default: ["content", "filename", "tags"]
          },
          path_filter: { type: "string", description: "Limit search to specific path prefix" },
        },
        required: ["query"],
      },
    },
  • MCP tool call handler in ObsidianMcpServer's switch statement that dispatches search_vault requests to the client.searchVault method.
    case "search_vault":
      result = await this.client.searchVault(
        args?.query as string,
        args?.scope as string[],
        args?.path_filter as string
      );
      break;
  • Helper usage of searchVault within the legacy 'list_notes' tool handler for search functionality.
    result = await this.client.searchVault(searchQuery, ["content", "filename", "tags"]);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions 'advanced filtering', it doesn't describe what the search returns (full documents, snippets, metadata only), pagination behavior, performance characteristics, or authentication requirements. This is inadequate for a search tool with no annotation coverage.

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 clearly states the core functionality. Every word earns its place, with no redundant information or unnecessary elaboration.

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?

For a search tool with 3 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the search returns, how results are formatted, whether there are limits, or how it differs from other search/list tools on the server. The 'advanced filtering' mention is too vague to be helpful.

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%, so the schema already documents all three parameters thoroughly. The description adds minimal value beyond what's in the schema - it mentions 'advanced filtering' which aligns with the scope and path_filter parameters, but doesn't provide additional syntax or format details.

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 tool's purpose as searching vault content across files, filenames, and metadata with advanced filtering. It specifies the verb 'search' and resource 'vault content', but doesn't explicitly differentiate from sibling tools like 'find_related_notes' or 'list_notes' which might have overlapping functionality.

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 'find_related_notes', 'list_notes', or 'list_directory'. It mentions 'advanced filtering' but doesn't specify what makes this tool distinct from other search/list tools in the server.

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/j-shelfwood/obsidian-local-rest-api-mcp'

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