Skip to main content
Glama

create_attachment_token_tool

Create a time-limited upload or download token for a single Obsidian attachment, with a ready-to-use URL when configured, to avoid exposing the master API key.

Instructions

Create a short-lived, single-file upload/download token for the GET/PUT /attachments/{path} HTTP route, instead of handing out the server's master API_KEY. method: 'PUT' (upload) or 'GET' (download). expires_in: seconds until the token expires (default 300, max 3600).

If the server has PUBLIC_BASE_URL configured, url is the ready-to-use request URL — use it as-is, it already has everything this token needs (including ?vault= when relevant) baked in. Otherwise build it yourself as: curl -X PUT --data-binary @file.png
"http://host:port/attachments/{path}?exp={expires_at}&sig={sig}&vault={vault}" (omit &vault=... only if the returned vault equals the server's single/default vault — see list_vaults_tool). The token only authorizes this exact path + method + vault and stops working after expires_at. In multi-vault mode, requires an api_key identity — GitHub-OAuth identities have no static secret of their own to sign with; use a plain Authorization: Bearer request against /attachments/* instead (that path works for any identity type, but needs ?vault= added by hand if targeting a non-default vault, since nothing was pre-signed for it). data: {method, vault, expires_at, sig, url?}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
vaultNo
methodNoPUT
expires_inNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries full responsibility and does so thoroughly. It discloses token scoping, expiry, exact authorization constraints, the multi-vault api_key requirement, the OAuth limitation, and the conditional presence of url. It also documents the returned data shape, leaving little hidden behavior.

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 long but dense, and each section earns its place: purpose, parameter meanings, URL construction, authorization caveats, and return shape. It is front-loaded with the core purpose and could be tightened with structured bullets, but the verbosity is justified by the tool's complexity and security edge cases.

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

Completeness4/5

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

For a 4-parameter tool with no parameter descriptions and no annotations, the description is unusually complete: it covers defaults, max expiry, URL assembly, multi-vault behavior, OAuth limitations, and the return payload. It falls just short of full completeness because it never explicitly defines the expected path format and only shows the PUT curl variant.

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 description coverage is 0%, and the description compensates for most parameters: method is defined as PUT or GET, expires_in is defined in seconds with default and max, path appears in the route and curl template, and vault is explained through the default-vault caveat. The main gap is that the required path parameter is never semantically defined beyond being a URL placeholder.

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?

States a specific verb and resource: 'Create a short-lived, single-file upload/download token for the GET/PUT /attachments/{path} HTTP route.' It also distinguishes itself from direct attachment tools by explaining it exists to avoid handing out the server's master API_KEY, making its unique role clear among siblings like add_attachment_tool and read_attachment_tool.

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

Usage Guidelines5/5

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

Provides explicit usage branches: if PUBLIC_BASE_URL is configured, use the returned url as-is; otherwise build the curl request manually. It also names an exclusion, directing GitHub-OAuth identities to use a plain Authorization: Bearer request against /attachments/* instead, and references list_vaults_tool for the default-vault check.

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