Skip to main content
Glama
jagoff

obsidian-mcp-complete

by jagoff

obsidian_vault_suggest

Read-only

Analyzes Obsidian vault to suggest reorganization actions like creating MOCs, consolidating notes, archiving candidates, and identifying missing tags.

Instructions

Suggest vault reorganization actions: MOCs, consolidation, archive candidates, and missing tags.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vaultNoOptional configured vault name. Defaults to the server default vault.
staleDaysNo
maxSuggestionsNo

Implementation Reference

  • src/tools.ts:869-883 (registration)
    Registration of the 'obsidian_vault_suggest' tool with its schema and handler. Calls vaultThemes and vaultSuggestions from intelligence.ts.
    tool(
      "obsidian_vault_suggest",
      "Suggest vault reorganization actions: MOCs, consolidation, archive candidates, and missing tags.",
      {
        vault: vaultArg,
        staleDays: z.number().int().min(30).max(5000).optional().default(365),
        maxSuggestions: z.number().int().min(1).max(200).optional().default(50),
      },
      async (args) => {
        const notes = await loadNotes(vaults, args.vault);
        const themes = vaultThemes(notes, 30, 2).themes;
        return { themes, suggestions: vaultSuggestions(notes, themes, args) };
      },
      { readOnlyHint: true },
    );
  • Input schema for obsidian_vault_suggest: vault (optional string), staleDays (optional int, default 365), maxSuggestions (optional int, default 50).
    "obsidian_vault_suggest",
    "Suggest vault reorganization actions: MOCs, consolidation, archive candidates, and missing tags.",
    {
      vault: vaultArg,
      staleDays: z.number().int().min(30).max(5000).optional().default(365),
      maxSuggestions: z.number().int().min(1).max(200).optional().default(50),
    },
  • Handler function for obsidian_vault_suggest: loads notes, computes themes via vaultThemes(), and generates suggestions via vaultSuggestions().
    async (args) => {
      const notes = await loadNotes(vaults, args.vault);
      const themes = vaultThemes(notes, 30, 2).themes;
      return { themes, suggestions: vaultSuggestions(notes, themes, args) };
    },
    { readOnlyHint: true },
  • The vaultSuggestions() function that generates reorganization suggestions (MOC creation, consolidation, archiving, tagging) based on notes, themes, and options.
    export function vaultSuggestions(
      notes: NoteRecord[],
      themes: Theme[],
      options: { staleDays?: number; maxSuggestions?: number } = {},
    ): Suggestion[] {
      const staleCutoff = Date.now() - (options.staleDays ?? 365) * 24 * 60 * 60 * 1000;
      const suggestions: Suggestion[] = [];
      for (const theme of themes) {
        if (theme.files.length >= 5) {
          suggestions.push({
            type: "create_moc",
            priority: "medium",
            action: `Create MOC-${safeTitle(theme.label)}.md linking ${theme.files.length} notes`,
            paths: theme.files,
            reason: `Theme "${theme.label}" has enough related notes to justify a map-of-content note.`,
          });
        }
        if (theme.crossFolder && theme.files.length >= 3) {
          const dominant = dominantFolder(theme.files);
          suggestions.push({
            type: "consolidate",
            priority: "low",
            action: `Review whether ${theme.files.length} "${theme.label}" notes should live closer to ${dominant}/`,
            paths: theme.files,
            reason: `The theme spans ${theme.folders.length} folders: ${theme.folders.join(", ")}.`,
          });
        }
      }
      for (const note of notes) {
        const modified = Date.parse(note.mtime);
        if (Number.isFinite(modified) && modified < staleCutoff && note.path.split("/")[0] !== "04-Archive") {
          suggestions.push({
            type: "archive",
            priority: "low",
            action: `Consider archiving ${note.path}`,
            paths: [note.path],
            reason: `Not modified since ${note.mtime.slice(0, 10)}.`,
          });
        }
        if (note.tags.length === 0 && extractHeadings(note.content).length > 1) {
          suggestions.push({
            type: "tag",
            priority: "low",
            action: `Add tags to ${note.path}`,
            paths: [note.path],
            reason: "The note has structure but no discovered tags.",
          });
        }
      }
      return suggestions.slice(0, options.maxSuggestions ?? 50);
    }
  • The vaultThemes() function that clusters notes into themes using TF-IDF-style term extraction, used by obsidian_vault_suggest.
    export function vaultThemes(notes: NoteRecord[], limit = 20, minFiles = 2): { themes: Theme[]; orphanCandidates: string[] } {
      const topTermsByNote = notes.map((note) => ({
        note,
        terms: topTerms(note, 12),
      }));
      const themes: Theme[] = [];
      for (const item of topTermsByNote) {
        if (item.terms.length === 0) continue;
        let best: { theme: Theme; score: number } | null = null;
        for (const theme of themes) {
          const overlap = jaccard(new Set(item.terms.slice(0, 8)), new Set(theme.keyTerms.slice(0, 8)));
          if (!best || overlap > best.score) best = { theme, score: overlap };
        }
        if (best && best.score >= 0.25) {
          best.theme.files.push(item.note.path);
          best.theme.keyTerms = mergeTopTerms(best.theme.keyTerms, item.terms);
          best.theme.folders = uniqueFolders(best.theme.files);
          best.theme.crossFolder = best.theme.folders.length > 1;
          best.theme.coherence = Number(((best.theme.coherence + best.score) / 2).toFixed(3));
        } else {
          const files = [item.note.path];
          themes.push({
            id: `theme-${themes.length + 1}`,
            label: labelFromTerms(item.terms),
            keyTerms: item.terms,
            files,
            folders: uniqueFolders(files),
            coherence: 1,
            crossFolder: false,
          });
        }
      }
      const filtered = themes
        .filter((theme) => theme.files.length >= minFiles)
        .map((theme, i) => ({ ...theme, id: `theme-${i + 1}`, label: labelFromTerms(theme.keyTerms) }))
        .sort((a, b) => b.files.length - a.files.length || b.coherence - a.coherence)
        .slice(0, limit);
      const themed = new Set(filtered.flatMap((theme) => theme.files));
      return {
        themes: filtered,
        orphanCandidates: notes.filter((note) => !themed.has(note.path)).map((note) => note.path).slice(0, 100),
      };
    }
Behavior3/5

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

Annotations already indicate readOnlyHint=true and destructiveHint=false. The description adds no further behavioral details beyond stating it 'suggests' actions, which aligns but does not disclose traits like how suggestions are generated or any performance implications.

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, clear sentence with no redundant information, making it highly concise and front-loaded.

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?

Despite being a read-only tool, the lack of output schema and the low schema coverage mean the description should offer more context about what the suggestions look like or how they are structured. It also does not explain the role of 'staleDays' even though it is a key parameter. The description is too sparse for an agent to understand the tool's full output and behavior.

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

Parameters2/5

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

With only 33% schema description coverage, the description should compensate by explaining parameter meaning, but it does not mention any parameters (staleDays, maxSuggestions, vault). The schema provides minimal help, leaving the agent without sufficient guidance on how to use the parameters.

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 'Suggest vault reorganization actions: MOCs, consolidation, archive candidates, and missing tags' uses a specific verb ('suggest') and identifies clear resources (MOCs, consolidation, etc.), differentiating it from sibling tools like obsidian_find_orphans or obsidian_list_tags.

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 vault reorganization but does not explicitly provide when-to-use or when-not-to-use guidance, nor does it mention alternatives among the many sibling tools.

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

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