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"]);

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