Skip to main content
Glama
Zotero MCP
by 54yyyu

Zotero Attach File

zotero_attach_file

Attach a local file or direct PDF URL to an existing Zotero item, using import or linked-file mode, skipping duplicate uploads, and returning the attachment key.

Instructions

Attach a file to an EXISTING regular item (not an attachment or note). To create a new item from a file, use zotero_add_item(source=). Give exactly one of file_path (absolute; any regular file, no symlinks or .lnk) or url (a direct PDF link, downloaded by the server). filename: overrides the stored name. link_mode: 'import' (default) uploads a copy, which counts against Zotero storage unless WebDAV is set up; 'linked' links the file where it is (file_path only, nothing copied). Skips the upload when the item already has the same file. Returns the attachment key.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "item_key": "<item_key>"
    },
    "name": "zotero_attach_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNo
filenameNo
item_keyYes
file_pathNo
link_modeNoimport

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.17.3
    • removedInput schema / properties / file_path / default
      Removed value: -null
    • removedInput schema / properties / filename / default
      Removed value: -null
    • removedInput schema / properties / url / default
      Removed value: -null
  2. Changed7 schema fields changedv0.16.0
    • removedInput schema / properties / file_path / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / file_path / type
      Added value: +"string"
    • removedInput schema / properties / filename / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / filename / type
      Added value: +"string"
    • removedInput schema / properties / url / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / url / type
      Added value: +"string"
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "type": "object",
      -  "x-fastmcp-wrap-result": true
      -}New value: +null
  3. Changed1 schema field changedv0.15.2
    • addedInput schema / properties / link_mode
      Added value: +{
      +  "default": "import",
      +  "type": "string"
      +}
  4. Addedv0.6.4

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses that 'import' consumes Zotero storage quota, that 'linked' copies nothing, that url files are downloaded server-side, that duplicate uploads are skipped, and that the attachment key is returned. It does not cover failure modes (invalid item_key, non-PDF URL, symlink rejection reasons) or whether local write authorization is required, which leaves a real gap for a mutation 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?

Front-loaded with purpose and exclusion before diving into parameter detail, and no sentence is filler. However, five dense clauses are packed into a single paragraph, so mode-specific and parameter-specific facts are harder to scan than a short bulleted breakdown would be.

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?

Given five parameters, no annotations, and no output schema, the definition covers what the tool does, how each parameter behaves, the storage trade-off, and the return value. What is missing is error behavior and any note about authorization (a sibling tool, zotero_authorize_local_writes, hints that write setup may be a prerequisite for some modes).

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?

Schema coverage is 0%, and the description compensates for every parameter: file_path's absolute/no-symlink/.lnk constraint, url's direct-PDF requirement, filename's override behavior, link_mode's two values and their consequences, and the exactly-one-of constraint that is absent from the schema. This is meaningfully more than the schema conveys.

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?

Opens with a specific verb and resource ('Attach a file to an EXISTING regular item') and immediately scopes it by excluding attachments and notes. It also names the sibling tool that handles the adjacent case (zotero_add_item with source=<path>), so an agent can distinguish the two without inspecting schemas.

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?

Explicitly states when to use this tool ('EXISTING regular item') and when to use the alternative (create a new item from a file), plus the mutually exclusive file_path vs url condition. It also explains the link_mode choice as a decision (storage cost vs. no copy) rather than a bare enum, which is exactly the guidance an agent needs to pick a mode.

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