Skip to main content
Glama

Zotero attachments (files)

zotero_attachment
Destructive

Manage Zotero attachment files: upload a local file or URL as an attachment, download an attachment to disk, or inspect its metadata.

Instructions

Upload, download, or inspect attachment files. action: "upload" stores a file as a Zotero attachment using the full File Storage protocol (provide url to have Zoteus fetch it, or file_path for a file on the machine running Zoteus; optional parent_item to attach it under an item, title, content_type) and returns the new attachment key; "download" fetches an attachment's file to a local path (provide item_key; optional save_path, default under the Zoteus data dir) and returns the path and byte count; "info" returns an attachment item's metadata. File bytes are written to / read from disk, never streamed through the conversation. Upload/download use the cloud Web API and your file-storage quota. When Zoteus runs on a different machine than Zotero, file_path refers to the server's disk, so use url instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoURL to download and upload instead of `file_path`; works on remote/hosted servers.
titleNoAttachment title (upload), e.g. "Full Text PDF"; the filename is used when omitted.
actionYesWhat to do. "upload" stores a file as an attachment (needs `file_path` or `url`); "download" writes an attachment's file to disk (needs `item_key`); "info" returns the attachment item's metadata.
item_keyNoAttachment item key (download/info).
file_pathNoFile to upload, on the machine running Zoteus.
overwriteNoAllow `save_path` to replace a file that already exists (default false).
save_pathNoWhere to write the downloaded file.
library_idNoNumeric id of the library to address, e.g. 5234875 for a group (zotero_groups lists the ids you can reach). Omit to use the configured default library; an id given without library_type is read as a group id.
parent_itemNoParent item key to attach under (upload).
content_typeNoMIME type of the uploaded file, e.g. "application/pdf"; inferred from the filename when omitted.
library_typeNoWhich library to address: "user" (a personal library) or "group" (a shared group library). Omit to use the library this server is configured for. "group" on its own is refused: pass library_id with it.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNoaction:"upload": key of the attachment item created.
bytesNoBytes uploaded or written.
existsNoTrue when Zotero already held these bytes and only the item was created.
filenameNoFile name stored.
savePathNoaction:"download": where the file was written.
attachmentNoaction:"info": the attachment item's full record.
contentTypeNoMIME type of the downloaded file.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.21.0
    • addedInput schema / properties / library_id / exclusiveMinimum
      Added value: +0
  2. Changed2 schema fields changedv1.20.2
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedOutput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  3. Changed6 schema fields changedv1.20.0
    • addedInput schema / properties / action / description
      Added value: +"What to do. \"upload\" stores a file as an attachment (needs `file_path` or `url`); \"download\" writes an attachment's file to disk (needs `item_key`); \"info\" returns the attachment item's metadata."
    • addedInput schema / properties / content_type / description
      Added value: +"MIME type of the uploaded file, e.g. \"application/pdf\"; inferred from the filename when omitted."
    • addedInput schema / properties / library_id / description
      Added value: +"Numeric id of the library to address, e.g. 5234875 for a group (zotero_groups lists the ids you can reach). Omit to use the configured default library; an id given without library_type is read as a group id."
    • addedInput schema / properties / library_type / description
      Added value: +"Which library to address: \"user\" (a personal library) or \"group\" (a shared group library). Omit to use the library this server is configured for. \"group\" on its own is refused: pass library_id with it."
    • addedInput schema / properties / title / description
      Added value: +"Attachment title (upload), e.g. \"Full Text PDF\"; the filename is used when omitted."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "properties": {
      +    "attachment": {
      +      "additionalProperties": {},
      +      "description": "action:\"info\": the attachment item's full record.",
      +      "type": "object"
      +    },
      +    "bytes": {
      +      "description": "Bytes uploaded or written.",
      +      "type": "number"
      +    },
      +    "contentType": {
      +      "description": "MIME type of the downloaded file.",
      +      "type": "string"
      +    },
      +    "exists": {
      +      "description": "True when Zotero already held these bytes and only the item was created.",
      +      "type": "boolean"
      +    },
      +    "filename": {
      +      "description": "File name stored.",
      +      "type": "string"
      +    },
      +    "key": {
      +      "description": "action:\"upload\": key of the attachment item created.",
      +      "type": "string"
      +    },
      +    "savePath": {
      +      "description": "action:\"download\": where the file was written.",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  4. Changed1 schema field changedv1.14.0
    • addedInput schema / properties / overwrite
      Added value: +{
      +  "description": "Allow `save_path` to replace a file that already exists (default false).",
      +  "type": "boolean"
      +}
  5. Changed2 schema fields changedv1.6.0
    • changedInput schema / properties / file_path / description
      Previous value: -"Local file to upload."New value: +"File to upload, on the machine running Zoteus."
    • addedInput schema / properties / url
      Added value: +{
      +  "description": "URL to download and upload instead of `file_path`; works on remote/hosted servers.",
      +  "format": "uri",
      +  "type": "string"
      +}
  6. First observedv1.0.4

TDQS

A4.5/5.0
Behavior4/5

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

The annotations already declare destructiveHint=true and readOnlyHint=false, so the description doesn't need to restate those. It adds valuable behavioral context: files are never streamed through the conversation, upload/download consume the cloud Web API and file-storage quota, and file_path refers to the server's disk when Zoteus runs remotely. These details go beyond what annotations provide and help the agent understand side effects and resource implications.

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 a single dense paragraph of roughly 150 words, but every sentence earns its place: it defines the actions, explains parameter dependencies, notes the disk/quota behavior, and includes the remote-server caveat. The most critical information (the three actions and their requirements) is front-loaded, and there is no filler or repetition.

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 tool's complexity (11 parameters, three distinct actions) and the presence of an output schema, the description covers all the essential usage scenarios and edge cases. It explains the return values for each action, the file handling behavior, and the server-location nuance. An agent has enough information to select the correct action and parameters without needing to open the schema.

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 coverage is 100%, so the baseline is 3. The description adds meaning beyond the schema by explaining how the action parameter selects which other parameters are required (e.g., upload needs file_path or url, download needs item_key) and by clarifying the file_path vs url trade-off and the remote-machine caveat. This enriches the schema's dry parameter definitions.

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 specific action set ('Upload, download, or inspect attachment files') and then enumerates the three actions with their exact behaviors and return values. It clearly identifies the resource (attachment files) and differentiates the tool's scope from siblings by covering all three modes in one place. This is more than a restatement of the name.

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 the conditions under which each action is appropriate (e.g., 'provide url to have Zoteus fetch it, or file_path for a file on the machine running Zoteus') and includes a specific usage note for remote machines ('use url instead'). However, it does not explicitly contrast with sibling tools like zotero_attach_file, leaving some ambiguity about when to prefer this tool over that one. The context is clear but lacks explicit exclusions or alternative mentions.

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