Skip to content

fix(tools): correct download_attachment annotation; complete parameter descriptions#21

Merged
sethbang merged 3 commits into
mainfrom
fix/tool-descriptions
May 30, 2026
Merged

fix(tools): correct download_attachment annotation; complete parameter descriptions#21
sethbang merged 3 commits into
mainfrom
fix/tool-descriptions

Conversation

@sethbang
Copy link
Copy Markdown
Owner

What

Lifts the MCP tool-description quality that Glama grades, and fixes one real annotation bug.

Bug: download_attachment annotation

Was readOnlyHint: true but the tool writes to disk when saveTo is set (fs.writeFile). Corrected to readOnlyHint: false (destructiveHint: false, idempotentHint: true) and clarified the description (inline = read-only; saveTo is the only side effect). This matters for agent auto-approval — a tool that can write must not advertise read-only.

Parameter descriptions

A listTools probe showed 6 tools emitting parameters with no descriptions (the "0% schema coverage" Glama flagged). Added per-field .describe() to:

count_messages, folder_stats, delete_thread, flag_thread, bulk_update_flags, bulk_update_labels.

Descriptions cover syntax (flag formats \Seen vs bare keywords; label paths must start with Labels/), constraints (uids XOR match; at least one of add/remove non-empty), and when-to-use guidance (single vs bulk vs thread; run dryRun first).

The other ~25 tools already had full descriptions — left untouched.

Verification

  • listTools probe: all 31 registered tools now emit a description for every parameter (list_folders has 0 params).
  • npm run build, npm run lint, npm run format:check, and 366 tests all pass.

Follow-up (not in this PR)

After merge, cut a release (tag vX.Y.Zpublish.yml ships to npm with provenance) and re-trigger Glama's scan — grades reflect the scanned npm artifact, so they won't move until a new version is published.

🤖 Generated with Claude Code

sethbang and others added 3 commits May 30, 2026 07:08
… descriptions

Improves MCP tool-description quality (the dimensions Glama grades).

- download_attachment was annotated readOnlyHint:true but WRITES to disk when
  saveTo is set. Corrected to readOnlyHint:false (destructiveHint:false,
  idempotentHint:true) and clarified in the description that inline calls are
  read-only while saveTo is the only side effect. Matters for agent
  auto-approval — a tool that can write must not advertise as read-only.

- Added per-parameter .describe() to the 6 tools whose params previously
  reached the wire with no descriptions: count_messages, folder_stats,
  delete_thread, flag_thread, bulk_update_flags, bulk_update_labels. Covers
  syntax (flag formats \Seen vs bare keywords; label paths must start with
  Labels/), constraints (uids XOR match; at least one of add/remove), and
  when-to-use guidance (single vs bulk vs thread; dryRun first).

Verified via a listTools probe: all 31 registered tools now emit a description
for every parameter (list_folders has 0 params). build, lint, format:check,
and 366 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…egation tools

Follow-up to the prior commit, which missed several tools whose old-string
edits silently failed. A listTools probe now confirms ALL 31 registered tools
emit a description for every parameter (was: bulk_update_flags 0/6,
bulk_update_labels 0/6, bulk_delete 3/6, top_senders 1/6, move_thread 1/4).

Covers: uids XOR match constraint, flag/label syntax, dryRun-first guidance,
date-range and scanLimit semantics on top_senders, and acrossFolders behavior
on move_thread.

Verified: probe shows full coverage; build, format:check, and 366 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sethbang sethbang merged commit 35b3035 into main May 30, 2026
1 check passed
@sethbang sethbang deleted the fix/tool-descriptions branch May 30, 2026 13:20
sethbang added a commit that referenced this pull request May 30, 2026
Release the download_attachment annotation fix and complete tool-parameter
descriptions (#21). Bumps every version reference for consistency, including
two that had drifted:

- package.json 1.0.1 -> 1.0.2
- package-lock.json (top-level + root package entry) 1.0.0 -> 1.0.2 (was
  never bumped for 1.0.1)
- server.json top-level + npm package entry 1.0.1 -> 1.0.2
- src/index.ts McpServer({version}) 1.0.0 -> 1.0.2 (the server had been
  reporting 1.0.0 over MCP regardless of the published version)

build, lint, format:check, and 366 tests pass.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant