Skip to main content
Glama
Code Mode for Zotero

Code Mode for Zotero

by ltalignani

Execute

execute

Run sandboxed Python to search, filter, and read your Zotero library items, full text, and passages. Returns only printed output, so results can be cited with page numbers.

Instructions

Run Python that reads the user's Zotero library. A global zotero offers search(), get_item(), fulltext(), find() and passages() (meaning-based search over the PDF text, with page numbers; see search_api for details); results are plain dicts and lists. Only what you print(), or a final bare expression, is returned, so filter and summarise in code instead of printing everything. Read-only; no network or file access.

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": {
      "code": "<code>"
    },
    "name": "execute"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes
timeout_secondsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the whole burden and does disclose key traits: read-only, no network or file access, and that only print() output or a final bare expression is returned. It omits error/failure behavior, execution limits, and says nothing about the timeout_seconds parameter, leaving meaningful behavioral gaps for an arbitrary-code-execution 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 the core action, then environment details, then constraints. Dense but nearly every clause carries information; the long parenthetical about passages() is the only slightly heavy element.

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 code-execution tool the description covers the environment, the result-return convention, and sandbox restrictions, and an output schema exists so return shape need not be spelled out. The main missing piece is the timeout parameter and what happens on timeout or exception.

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 description coverage is 0%, so the description must compensate. It does add real meaning for `code` by naming the available API surface and the output/return convention, but `timeout_seconds` is never mentioned, so half the parameters remain undocumented anywhere.

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: run Python against the user's Zotero library, with a `zotero` global exposing search(), get_item(), fulltext(), find() and passages(). It also distinguishes itself from search_api by delegating API details there, so an agent knows this is the general-purpose code path rather than a fixed query tool.

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?

Gives clear operating guidance: filter and summarise in code rather than printing everything, and consult search_api for search semantics. It lacks an explicit statement of when to prefer this over search_api (or vice versa) beyond the pointer, so it falls short of full when/when-not routing.

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