Skip to main content
Glama

base_query

Execute a query against an Obsidian Bases .base file to retrieve rows. Provide a vault-relative file path or inline YAML, specify the view name, and get results with row count.

Instructions

Evaluate an Obsidian Bases .base file and return its rows. Requires the obsidian-brain companion plugin installed, a recent Obsidian (1.10.0+) running against the same vault, and the Bases core plugin enabled (Obsidian → Settings → Core plugins → Bases). Obsidian does not yet expose a public API for headless Bases query execution (Plugin.registerBasesView() is a view-factory hook only). The plugin uses its own YAML parser + a whitelisted expression subset (Path B). See docs/plugin.md#bases for the full supported subset. Supported subset: tree ops (and/or/not), comparisons (==, !=, >, >=, <, <=), leaf boolean (&&, ||, !), file.{name, path, folder, ext, size, mtime, ctime, tags}, file.hasTag("x"), file.inFolder("x"), frontmatter dot-paths. Arithmetic (+, -, *, /, %), method calls other than hasTag/inFolder, function calls (today(), now(), etc.), regex literals, formulas:, summaries:, and this context references all return 400 unsupported_construct errors — they ship in subsequent plugin patches as users hit them. Provide either file (vault-relative path to a .base file) or yaml (inline .base YAML source); view names which view inside the file to execute. Returns { view, rows, total, executedAt } — rows contain {file: {name, path}, ...projected columns}, total is the pre-limit count. Default 30s timeout (override with timeoutMs). Timeout only cancels the HTTP wait; the plugin has no cancellation API, so a running evaluation keeps going inside Obsidian. Prefer a limit: in the view for open-ended queries over large vaults.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoVault-relative path to a `.base` YAML file (e.g. "Bases/Books.base"). Either `file` or `yaml` is required.
yamlNoInline `.base` YAML source. Either `file` or `yaml` is required.
viewYesThe name of the view inside the `.base` file to execute, e.g. "active-books".
timeoutMsNoHTTP timeout in ms (default 30000). The plugin evaluator itself cannot be cancelled; this just bounds how long this tool waits.
Behavior5/5

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

No annotations provided, so description carries full burden. Discloses plugin dependency, limitations of Obsidian API, unsupported construct errors, timeout behavior (only cancels HTTP wait, not plugin execution), and return format. Exceptionally transparent.

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?

Front-loaded with purpose and prerequisites. Well-structured with clear sections. Slightly verbose on unsupported constructs list, but justified by complexity. No wasted sentences.

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

Completeness5/5

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

Complete coverage for a complex tool: prerequisites, parameter details, return structure, error cases, limitations, and timeout behavior. No output schema, but description adequately fills the gap.

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

Parameters4/5

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

Schema covers 100% of parameters (baseline 3). Description adds value by clarifying mutual exclusivity of file/yaml, giving example for view, and explaining timeoutMs behavior beyond schema.

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?

Explicitly states the verb 'evaluate', the resource '.base file', and the output 'return its rows'. Clear distinction from sibling tools by focusing on Obsidian Bases, with prerequisites listed.

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?

Provides explicit prerequisites (plugin, Obsidian version, core plugin) and when-not-to-use (unsupported constructs return 400). Suggests using limit: for open-ended queries. However, lacks direct comparison to sibling tool 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/sweir1/obsidian-brain'

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