Skip to main content
Glama
bezata

kObsidian MCP

List Notes By Folder

dataview.listByFolder
Read-onlyIdempotent

List all notes in a specified vault folder, with optional filtering, sorting, and limit using Dataview queries.

Instructions

Convenience wrapper that runs LIST FROM "folder" (optionally with WHERE, SORT, and LIMIT clauses). Useful when you want every note under a vault folder. Requires the Dataview and Local REST API plugins.

Operates on the session-active vault (see vault.current — selectable via vault.select) unless an explicit vaultPath argument is passed, which always wins.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderYesVault-relative folder to filter by.
whereClauseNoOptional DQL `WHERE` clause body (without the `WHERE` keyword).
sortByNoOptional DQL `SORT` clause body (without the `SORT` keyword). Example: `file.ctime desc`.
limitNoOptional `LIMIT` n clause.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual handler function `listNotesByFolderDql` that builds a TABLE query from the folder argument and optional WHERE/SORT/LIMIT clauses, then delegates to `executeDataviewQuery`.
    export async function listNotesByFolderDql(
      context: DomainContext,
      args: { folder: string; whereClause?: string; sortBy?: string; limit?: number },
    ) {
      const query = [
        "TABLE file.name",
        `FROM "${args.folder}"`,
        args.whereClause ? `WHERE ${args.whereClause}` : "",
        args.sortBy ? `SORT ${args.sortBy}` : "",
        args.limit ? `LIMIT ${args.limit}` : "",
      ]
        .filter(Boolean)
        .join(" ");
      return executeDataviewQuery(context, { query });
    }
  • Zod schema for the tool's input arguments: required `folder` (string) plus optional `whereClause`, `sortBy`, and `limit` via `sharedDqlFields`.
    export const dataviewListByFolderArgsSchema = z
      .object({
        folder: z.string().min(1).describe("Vault-relative folder to filter by."),
        ...sharedDqlFields,
      })
      .strict()
      .describe('Sugar wrapper around `LIST FROM "folder"`.');
    export type DataviewListByFolderArgs = z.input<typeof dataviewListByFolderArgsSchema>;
  • Tool definition registration: sets name `dataview.listByFolder`, title, description, input/output schemas, annotations, and the handler that parses args and calls `listNotesByFolderDql`. Exported as part of the `dataviewTools` array.
    {
      name: "dataview.listByFolder",
      title: "List Notes By Folder",
      description:
        'Convenience wrapper that runs `LIST FROM "folder"` (optionally with `WHERE`, `SORT`, and `LIMIT` clauses). Useful when you want every note under a vault folder. Requires the Dataview and Local REST API plugins.',
      inputSchema: dataviewListByFolderArgsSchema,
      outputSchema: looseObjectSchema,
      annotations: READ_ONLY_OPEN_WORLD,
      handler: async (context, rawArgs) => {
        const args = dataviewListByFolderArgsSchema.parse(rawArgs) as DataviewListByFolderArgs;
        return listNotesByFolderDql(context, args);
      },
    },
Behavior4/5

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

Annotations already declare readOnlyHint, destructiveHint, idempotentHint, and openWorldHint. The description adds value by noting the dependency on Dataview and Local REST API plugins, and explaining vault selection behavior. No contradictions with annotations.

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 two concise sentences, front-loaded with the core purpose and usage context. Every sentence adds value: purpose, equivalence to LIST FROM, use case, requirements, and vault selection rule. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 4 parameters, an output schema, and annotations, the description is complete enough. It explains the tool's purpose, requirements, and vault selection. It does not need to describe output since the output schema exists. Sibling differentiation is minimal but acceptable.

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 description does not need to add much. It repeats that parameters are optional DQL clauses, but does not provide additional semantics beyond what the schema already offers. Baseline 3 is appropriate.

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 is a convenience wrapper for listing notes under a vault folder, using specific verb 'lists notes by folder' and explicitly mentions it runs LIST FROM with optional clauses. It distinguishes itself from sibling tools like dataview.listByTag by focusing on folder filtering.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description advises when to use the tool: 'Useful when you want every note under a vault folder.' It also provides guidelines on vault selection (session-active vs explicit vaultPath). However, it does not explicitly mention when not to use it or compare with alternatives like dataview.query.

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/bezata/kObsidian'

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