Skip to main content
Glama
bezata

kObsidian MCP

Write Dataview Fields

dataview.fields.write
Idempotent

Insert or delete a Dataview field in a note with customizable syntax and placement. Supports add/remove operations, key-value pairs, and multiple syntax types. Idempotent.

Instructions

Insert or remove a Dataview field in a single note. op:'add' inserts a key:: value field; syntaxType picks the rendering (full-line = own line; bracket = [key:: value]; paren = (key:: value)); insertAt chooses placement (start, end, afterFrontmatter) unless lineNumber is given for precise control. op:'remove' deletes every occurrence of key (optionally restricted to a single lineNumber or a Dataview scope). Idempotent — re-running with the same args converges on the same document state.

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

Examples:

Example 1 — Add a full-line priority field after the frontmatter:

{
  "op": "add",
  "filePath": "Projects/Alpha.md",
  "key": "priority",
  "value": "high",
  "syntaxType": "full-line",
  "insertAt": "afterFrontmatter"
}

Example 2 — Remove every occurrence of the status field from a note:

{
  "op": "remove",
  "filePath": "Projects/Alpha.md",
  "key": "status",
  "scope": "all"
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
changedYesTrue if the tool altered vault state on this call; false if it was a no-op.
targetYesThe path or identifier the tool acted on.
summaryYesShort human-readable summary of what happened.
Behavior5/5

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

The description provides extensive behavioral details beyond the annotations: idempotent behavior, three syntax types, placement options, and the vault precedence rule. It aligns with the annotations (idempotentHint true) and adds actionable context.

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 well-structured with a clear overview followed by parameter details and two JSON examples. It is slightly verbose but every sentence adds value. The information is front-loaded effectively.

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?

Given the complexity of a write tool with multiple modes, the description covers all necessary aspects: operation types, parameter details, idempotency, vault context, and examples. The output schema exists so return values need not be explained.

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

Parameters5/5

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

The input schema has no parameters (coverage 100%), so the baseline is 3. However, the description fully compensates by explaining all eight parameters (op, filePath, key, value, syntaxType, insertAt, lineNumber, scope, vaultPath) with valid values and semantics. This adds substantial value.

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 uses a specific verb 'Insert or remove' and clearly identifies the resource 'Dataview field in a single note'. It distinguishes itself from sibling tools like 'dataview.fields.read' by explicitly being a write operation.

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 explains when to use 'add' vs 'remove' and includes examples for common use cases. It notes idempotency, which guides re-runs. However, it does not explicitly state when not to use this tool or compare it to other write tools like 'notes.edit'.

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