Skip to main content
Glama
Obsidian CDP MCP Server

Obsidian CDP MCP Server

obsidian_dom_query

Queries DOM elements in Obsidian UI by CSS selector to inspect UI state, returning first or all matches and extracting attributes or text.

Instructions

Query DOM elements in Obsidian UI. Useful for inspecting UI state.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "selector": "<selector>"
    },
    "name": "obsidian_dom_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
allNoReturn all matching elements (default: false, returns first match)
selectorYesCSS selector to query
attributeNoAttribute to extract (default: innerHTML, use 'text' for textContent)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.9.2

TDQS

C2.9/5.0
Behavior2/5

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

No annotations exist, so the description carries the full disclosure burden, yet it never states that the operation is read-only, what scope the selector runs against (active view vs full workspace document), or what happens when no element matches. It also doesn't say whether a live element handle or a serialized string is returned, which matters for a DOM query.

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?

Two short sentences with the core purpose front-loaded and no filler or repetition. The second sentence is thin but not wasteful; the brevity costs detail rather than adding noise.

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

Completeness3/5

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

This is a simple three-parameter tool with full schema documentation, so the bar is modest. However, with no output schema and no annotations, the description should at least indicate the return shape (element vs attribute string) and selector scope, which it omits.

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 selector, all, and attribute are already fully documented in the input schema, including the default of innerHTML and the 'text' shortcut. The description adds no parameter meaning beyond that, so the baseline 3 applies.

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 gives a specific verb+resource: 'Query DOM elements in Obsidian UI', which is clearly distinguishable from the file/vault-oriented siblings like obsidian_read_file or obsidian_get_frontmatter. It stops short of differentiating from a general-purpose sibling such as obsidian_eval, which could also inspect UI state.

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?

'Useful for inspecting UI state' is the only usage hint; there is no statement of when to prefer this over alternatives (e.g., obsidian_eval) or when not to use it. The agent must infer the use case from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.