Skip to main content
Glama
bezata

kObsidian MCP

by bezata

Write Dataview Fields

dataview.fields.write
Idempotent

Add or remove Dataview key-value fields in Obsidian notes, with control over syntax, placement, and scope. Idempotent operations ensure consistent state.

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
targetYesThe path or identifier the tool acted on.
changedYesTrue if the tool altered vault state on this call; false if it was a no-op.
summaryYesShort human-readable summary of what happened.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed5 schema fields changedv0.3.5
    • addedInput schema / $schema
      Added value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / description
      Added value: +"Discriminated union on `op`. `add` inserts a Dataview field; `remove` deletes every occurrence of a key (optionally scoped by line or Dataview scope)."
    • addedInput schema / oneOf
      Added value: +[
      +  {
      +    "properties": {
      +      "filePath": {
      +        "maxLength": 255,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "insertAt": {
      +        "description": "Where to place the field in the note body. Defaults to `afterFrontmatter`. Ignored when `lineNumber` is given.",
      +        "enum": [
      +          "start",
      +          "end",
      +          "afterFrontmatter"
      +        ],
      +        "type": "string"
      +      },
      +      "key": {
      +        "description": "Dataview field key to insert.",
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "lineNumber": {
      +        "description": "Explicit 1-based line number to insert at. Overrides `insertAt`.",
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "op": {
      +        "const": "add",
      +        "type": "string"
      +      },
      +      "scope": {
      +        "enum": [
      +          "page",
      +          "list",
      +          "task"
      +        ],
      +        "type": "string"
      +      },
      +      "syntaxType": {
      +        "description": "How to render the field: `full-line` = field on its own line (`key:: value`); `bracket` = `[key:: value]` inline; `paren` = `(key:: value)` inline.",
      +        "enum": [
      +          "full-line",
      +          "bracket",
      +          "paren"
      +        ],
      +        "type": "string"
      +      },
      +      "value": {
      +        "description": "Field value. Strings, numbers, booleans, dates, and lists are all valid."
      +      },
      +      "vaultPath": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "op",
      +      "filePath",
      +      "key",
      +      "value"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "filePath": {
      +        "maxLength": 255,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "key": {
      +        "description": "Field key to remove.",
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "lineNumber": {
      +        "description": "Restrict removal to a single line. Omit to remove every occurrence of the key within `scope`.",
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "op": {
      +        "const": "remove",
      +        "type": "string"
      +      },
      +      "scope": {
      +        "enum": [
      +          "page",
      +          "list",
      +          "task",
      +          "all"
      +        ],
      +        "type": "string"
      +      },
      +      "vaultPath": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "op",
      +      "filePath",
      +      "key"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedInput schema / properties
      Removed value: -{}
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Addedv0.1.2

TDQS

A4.8/5.0
Behavior5/5

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

The description goes beyond the annotations by explaining exactly what each op does, including that remove 'deletes every occurrence' of a key, and explicitly discloses idempotence and vault selection behavior. No contradiction with annotations is apparent: idempotentHint matches, and the scoped field-write semantics are compatible with destructiveHint=false.

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 front-loaded with the core purpose, followed by compact parameter semantics, one behavioral caveat (idempotence/vault), and two worked examples. No sentence is filler; the length is justified by the two-branch op and several interacting options.

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?

For a tool with a discriminated union, multiple enums, and optional interactions, the description plus schema is complete enough to call it correctly: it covers both ops, placement, syntax, scope, vault selection, and default behavior for insertAt. The output schema exists, so return values are not the description's burden.

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?

Even with 100% schema coverage, the description adds substantial meaning: it defines how syntaxType renders the field, how insertAt and lineNumber interact, how scope restricts removal, and that vaultPath overrides the active vault. The two JSON examples tie the parameters together into valid call patterns.

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 opens with a precise verb+resource: 'Insert or remove a Dataview field in a single note.' It then explains the two op modes and rendering options, making the tool's function unmistakable and distinct from read-only siblings like dataview.fields.read.

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?

It clearly establishes when the tool is appropriate: whenever a single note's Dataview field needs to be added or removed, and it explains vault targeting (session-active vault versus explicit vaultPath). It does not explicitly name sibling alternatives or state when not to use it, so it falls just short of full routing guidance.

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

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