Skip to main content
Glama
YuNaga224

Obsidian Memory MCP

by YuNaga224

search_nodes

Find entities, relations, and observations in your Obsidian knowledge graph using search queries to match names, types, and content.

Instructions

Search for nodes in the knowledge graph based on a query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query to match against entity names, types, and observation content

Implementation Reference

  • Core implementation of the search_nodes tool logic: loads the knowledge graph, performs case-insensitive search on entity names, types, and observations, filters matching entities and their inter-relations.
    async searchNodes(query: string): Promise<KnowledgeGraph> {
      const graph = await this.loadGraph();
      const queryLower = query.toLowerCase();
      
      // Filter entities
      const filteredEntities = graph.entities.filter(e => 
        e.name.toLowerCase().includes(queryLower) ||
        e.entityType.toLowerCase().includes(queryLower) ||
        e.observations.some(o => o.toLowerCase().includes(queryLower))
      );
      
      // Get filtered entity names
      const filteredEntityNames = new Set(filteredEntities.map(e => e.name));
      
      // Filter relations to only include those between filtered entities
      const filteredRelations = graph.relations.filter(r => 
        filteredEntityNames.has(r.from) && filteredEntityNames.has(r.to)
      );
      
      return {
        entities: filteredEntities,
        relations: filteredRelations
      };
    }
  • index.ts:173-183 (registration)
    Registers the 'search_nodes' tool with the MCP server, including name, description, and input schema requiring a 'query' parameter.
    {
      name: "search_nodes",
      description: "Search for nodes in the knowledge graph based on a query",
      inputSchema: {
        type: "object",
        properties: {
          query: { type: "string", description: "The search query to match against entity names, types, and observation content" },
        },
        required: ["query"],
      },
    },
  • Top-level MCP CallTool handler case that delegates to storageManager.searchNodes and formats the response as JSON text content.
    case "search_nodes":
      return { content: [{ type: "text", text: JSON.stringify(await storageManager.searchNodes(args.query as string), null, 2) }] };
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. While 'search' implies a read operation, it doesn't specify whether this is paginated, rate-limited, permission-dependent, or what format results take. For a search tool with zero annotation coverage, this leaves significant behavioral gaps unaddressed.

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 states the core functionality without unnecessary elaboration. Every word earns its place, and the structure is front-loaded with the essential information. No wasted verbiage or redundant phrasing.

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 no annotations and no output schema, the description is insufficiently complete. It doesn't explain what constitutes a 'node', what fields are searched, how results are ranked, what the return format looks like, or any limitations. Given the complexity of knowledge graph search and the lack of structured metadata, more context is needed.

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 the single 'query' parameter thoroughly. The description adds no additional parameter semantics beyond what's in the schema - it mentions the query but doesn't elaborate on syntax, examples, or search behavior. Baseline 3 is appropriate when schema does the heavy lifting.

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 action ('search for nodes') and the target ('knowledge graph'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from potential sibling alternatives like 'open_nodes' or 'read_graph', which might also retrieve node information but through different mechanisms.

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 'open_nodes' and 'read_graph' that might also access node data, there's no indication of when search-based retrieval is preferred over direct access or full graph reading. No prerequisites, exclusions, or comparative context are mentioned.

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/YuNaga224/obsidian-memory-mcp'

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