Skip to main content
Glama
jagoff

obsidian-mcp-complete

by jagoff

obsidian_recent_notes

Read-only

Retrieve a list of recently modified notes, sorted newest first. Filter by folder, file extension, and limit results.

Instructions

List recently modified notes or files, sorted newest first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vaultNoOptional configured vault name. Defaults to the server default vault.
folderNo.
extensionNo.md
limitNo
offsetNo

Implementation Reference

  • src/tools.ts:243-259 (registration)
    Tool registration for 'obsidian_recent_notes' with its Zod schema and handler
    tool(
      "obsidian_recent_notes",
      "List recently modified notes or files, sorted newest first.",
      {
        vault: vaultArg,
        folder: z.string().optional().default("."),
        extension: z.string().optional().default(".md"),
        limit: z.number().int().min(1).max(1000).optional().default(50),
        offset: z.number().int().min(0).optional().default(0),
      },
      async (args) => {
        const entries = await vaults.listEntries(args.vault, { folder: args.folder, recursive: true, extension: args.extension, includeDirectories: false });
        const sorted = entries.sort((a, b) => b.mtime.localeCompare(a.mtime));
        return { total: sorted.length, offset: args.offset, notes: sorted.slice(args.offset, args.offset + args.limit) };
      },
      { readOnlyHint: true },
    );
  • Handler function: lists vault entries, sorts by mtime descending, paginates with limit/offset
    async (args) => {
      const entries = await vaults.listEntries(args.vault, { folder: args.folder, recursive: true, extension: args.extension, includeDirectories: false });
      const sorted = entries.sort((a, b) => b.mtime.localeCompare(a.mtime));
      return { total: sorted.length, offset: args.offset, notes: sorted.slice(args.offset, args.offset + args.limit) };
    },
  • Input schema: vault (optional), folder (default '.'), extension (default '.md'), limit (default 50), offset (default 0)
    {
      vault: vaultArg,
      folder: z.string().optional().default("."),
      extension: z.string().optional().default(".md"),
      limit: z.number().int().min(1).max(1000).optional().default(50),
      offset: z.number().int().min(0).optional().default(0),
    },
  • VaultManager.listEntries: uses fast-glob to list files/folders with filtering by extension, depth, and directory inclusion; returns VaultFileEntry[] sorted by path
    async listEntries(
      vaultName?: string | null,
      options: { folder?: string; recursive?: boolean; maxDepth?: number; extension?: string; includeDirectories?: boolean } = {},
    ): Promise<VaultFileEntry[]> {
      const vault = this.getVault(vaultName);
      const folder = normalizeRelativePath(options.folder || ".");
      const base = this.resolvePath(folder, vault.name);
      const depth = options.recursive ? options.maxDepth ?? 20 : 1;
      const pattern = options.recursive ? "**/*" : "*";
      const entries = await fg(pattern, {
        cwd: base.absolute,
        dot: false,
        onlyFiles: false,
        markDirectories: false,
        ignore: DEFAULT_IGNORES,
        deep: depth,
        stats: true,
        followSymbolicLinks: false,
      });
      const out: VaultFileEntry[] = [];
      for (const item of entries) {
        if (typeof item === "string") continue;
        const rel = toPosix(path.join(base.relative === "." ? "" : base.relative, item.path));
        const stats = item.stats;
        if (!stats) continue;
        const isDir = stats.isDirectory();
        if (isDir && options.includeDirectories === false) continue;
        const ext = path.posix.extname(rel);
        if (options.extension && ext.toLowerCase() !== normalizeExtension(options.extension)) continue;
        out.push({
          path: rel,
          name: path.posix.basename(rel),
          type: isDir ? "directory" : "file",
          size: stats.size,
          mtime: stats.mtime.toISOString(),
          extension: ext,
        });
      }
      return out.sort((a, b) => a.path.localeCompare(b.path));
    }
  • VaultFileEntry type definition: path, name, type, size, mtime (ISO string), extension
    export type VaultFileEntry = {
      path: string;
      name: string;
      type: "file" | "directory";
      size: number;
      mtime: string;
      extension: string;
    };
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds the sorting behavior (newest first) but does not mention default extension (.md) or pagination behavior, leaving gaps in transparency.

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 a single sentence that front-loads the verb 'List' and the core purpose, making it concise and easy to parse, though it omits important details.

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 tool with 5 parameters and no output schema, the description is insufficient; it does not explain filtering, pagination, or the return format, leaving the agent without crucial context for correct invocation.

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 20% schema description coverage, the description should compensate by explaining key parameters like folder, extension, limit, and offset, but it does not mention any of them beyond the implicit listing behavior.

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 it lists recently modified notes or files sorted newest first, which is specific and distinguishes it from other listing/search tools like obsidian_list_files or obsidian_search.

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 when to use (to see recent modifications), but does not explicitly state when not to use it or 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