Skip to main content
Glama

add_attachment

Save a file into an Obsidian vault from a local path, base64 data, or URL, place it in the attachment folder, and optionally embed it in a note.

Instructions

Save a file into the vault — from a local path, base64 data, or a URL — into the vault's attachment folder (per its settings, relative to for_note), and optionally embed it in that note.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "add_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNo
nameNoFile name (default: from source)
embedNoAppend an embed ![[file]] to for_note (default true when for_note is set)
vaultNoVault name, id or folder path (see list_vaults). Default: OBSIDIAN_VAULT or the vault open in Obsidian.
base64No
folderNoOverride destination folder
headingNo
for_noteNoNote the attachment belongs to
source_pathNoAbsolute path of a file on this machine

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Beyond the annotations (readOnly=false, openWorldHint=true, destructive=false, idempotent=false), the description explains that the destination is the vault's attachment folder per its settings, that it is resolved relative to for_note, that folder can override it, and that embedding appends an ![[file]] link to the note with a default of true when for_note is set. It does not state overwrite/name-collision behavior for an existing attachment or what happens on a failed URL fetch, which are meaningful gaps for a write tool.

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?

A single front-loaded sentence with the verb and source modes first, then destination and embed behavior; every clause carries information. The nested em-dash construction makes it dense to parse, but nothing is wasted.

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?

For a 9-parameter write tool with no output schema, the description covers destination and embed side effects but omits the return value (saved path?), overwrite semantics, and the source-parameter exclusivity rule. The missing exclusivity statement is the largest gap given zero required parameters.

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 coverage is 67%, and the description clarifies the source-mode intent and the folder-resolution/embed default that the schema only partly conveys. However, it never explains that exactly one of source_path, base64, or url must be supplied despite zero required parameters, and the undocumented 'heading' parameter gets no clarification in the description either.

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?

Names a specific verb (save a file) and resource (vault attachment folder) and enumerates the three supported source modes (local path, base64, URL), which separates it from siblings like copy_file and read_attachment. The optional embed-in-note clause further distinguishes it from embed_in_note, though the description never names those alternatives outright.

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

Usage Guidelines3/5

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

Usage is implied by the source-mode list and the note about embedding, but there is no explicit when-to-use, when-not-to-use, or routing to alternatives such as copy_file for files already in the vault or embed_in_note for a separate embed step. The agent must infer the selection rules.

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

Deploy Server

Other Tools