bradtraversy.dev — 2026-10-10-devstash-api-mcp-updates.md
● home.md ▸ projects/ ▸ tools/ ▸ devlog/ × ▸ articles/ ● now.md ● about.md
2026-10-10 · #devstash · #devlog #agents #nextjs

# devstash agents can edit existing items

links: site | repo | MCP docs | project page

The first DevStash MCP release could save an item, but it couldn’t edit one. That was a pretty obvious gap once I started using it. An agent should be able to update an existing note or snippet instead of saving another copy every time.

I’ve added update_item to MCP and PATCH /api/v1/items/{id} to the REST API. Both use the same partial-edit rules and shared write logic as the browser. I didn’t want three versions of what “edit an item” means.

Fields left out of a request keep their current values. Supported nullable fields can be cleared with null, and empty arrays clear tags or collection membership. An update can’t change the item’s type. Sharing stays a separate operation, and requests that mix visibility changes with content edits are rejected.

Collection membership needs care too. Moving a private item into a shared collection can expose it, even though the item’s own visibility hasn’t changed. The existing warning still applies when an agent changes collections.

Production verification went beyond checking that the tool appeared in the list. I saved a private test note through MCP, updated its title and content, read it back, deleted it, and searched again to confirm it was gone. The API’s partial-update and rejection cases passed live checks too.

One small gotcha: an already-running Codex task can retain the old tool list. The deployed server exposed update_item before that task discovered it. Starting a new task or reloading discovery is separate from deploying the tool.

// EOF 2026-10-10-devstash-api-mcp-updates.md
main
●
2026-10-10-devstash-api-mcp-updates.md
UTF-8
LF
Markdown
Ln 1, Col 1