Skip to main content
Glama
splitwise-mcp

splitwise-mcp

by chrischall

sw_attach_receipt

DestructiveIdempotent

Attach or replace a receipt image or PDF on an existing Splitwise expense without altering its cost, split, or description. Provide upload_id, local path, or base64; Splitwise must store the file.

Instructions

Attach (or replace) the receipt image or PDF on an existing Splitwise expense. Changes nothing else on the expense — cost, split and description are not sent. Pass the file as receipt.upload_id (hosted: upload it first via sw_get_upload_url — no bytes in the tool call), receipt.path (local) or receipt.base64. Fails if Splitwise does not store the file. An upload_id is deleted from the upload store once the file is stored (upload_deleted in the reply). Asks the user to confirm first: a confirmation prompt where the client supports one; otherwise the first call returns a preview and a confirmToken, and only a repeat call with that token proceeds (see MCP_CONFIRM_MODE).

Input Schema

NameRequiredDescriptionDefault
receiptYesReceipt to attach: PNG, JPEG, GIF or PDF, up to 10 MiB. Give exactly one of upload_id, path or base64. The type is detected from the file contents. Replaces any receipt already on the expense.
expense_idYesID of the expense to attach the receipt to
confirmTokenNoONLY for the two-step confirmation fallback (a client without MCP elicitation). The confirmToken from this same tool's phase-1 "confirmation-required" response, passed back ONLY after the user has seen that preview and explicitly approved it in chat — never on the first call, never invented, never reused. Call again with the same arguments. Ignored when the client supports elicitation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.7.0
    • changedInput schema / properties / receipt / properties / upload_id / description
      Previous value: -"The upload_id from sw_get_upload_url, after the file was PUT to its upload_url. The way to send a full-size file to the hosted server without base64."New value: +"The upload_id from sw_get_upload_url, after the file was PUT to its upload_url. The way to send a full-size file to the hosted server without base64. Single use: the upload is deleted once Splitwise has the receipt (the reply says upload_deleted); a failed or declined write keeps it, so the same upload_id can be retried."
  2. Changed4 schema fields changedv3.5.1
    • changedInput schema / properties / receipt / description
      Previous value: -"Receipt to attach: PNG, JPEG, GIF or PDF, up to 10 MiB. Give exactly one of base64 or path. The type is detected from the file contents. Replaces any receipt already on the expense."New value: +"Receipt to attach: PNG, JPEG, GIF or PDF, up to 10 MiB. Give exactly one of upload_id, path or base64. The type is detected from the file contents. Replaces any receipt already on the expense."
    • changedInput schema / properties / receipt / properties / base64 / description
      Previous value: -"The file bytes, base64-encoded (a data: URL prefix is accepted and stripped). The normal way to pass a receipt."New value: +"The file bytes, base64-encoded (a data: URL prefix is accepted and stripped). Costs context for every byte — on the hosted server prefer upload_id."
    • changedInput schema / properties / receipt / properties / path / description
      Previous value: -"A file inside SPLITWISE_INPUT_DIR on the machine running this server (relative to it, or absolute). Only works when that variable is set — never on a hosted server; use base64 there."New value: +"A file inside SPLITWISE_INPUT_DIR on the machine running this server (relative to it, or absolute). Only works when that variable is set — never on a hosted server; use upload_id (or base64) there."
    • addedInput schema / properties / receipt / properties / upload_id
      Added value: +{
      +  "description": "The upload_id from sw_get_upload_url, after the file was PUT to its upload_url. The way to send a full-size file to the hosted server without base64.",
      +  "minLength": 1,
      +  "type": "string"
      +}
  3. Addedv3.4.0

TDQS

A4.6/5.0
Behavior5/5

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

The annotations already flag destructive and idempotent behavior, and the description adds several things they cannot convey: that an existing receipt is replaced, that the write fails outright if Splitwise does not store the file, that upload_id is consumed on success (upload_deleted in the reply) but survives a declined or failed write for retry, and that a user confirmation gate exists. That is a rich behavioral profile beyond the structured hints, and nothing contradicts the annotations.

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?

The core action and its scope lead, then transport options, then failure/consumption semantics, then confirmation. Every sentence is load-bearing, though the closing sentence on confirmation modes is long and dense enough to slow the reader.

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?

With no output schema, the description still tells the agent what to look for in the reply (upload_deleted) and how the two-phase confirmation returns a preview and confirmToken. For a destructive nested-parameter write tool, that covers everything needed to call it correctly.

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 coverage is 100% and the parameters already carry detailed descriptions, including the exactly-one-of upload_id/path/base64 rule and the confirmToken semantics. The description repeats the file-transport options but adds no syntax or format detail the schema does not already supply, so this lands at the baseline.

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 uses a specific verb and resource ("Attach (or replace) the receipt image or PDF on an existing Splitwise expense") and immediately scopes what it does not touch ("cost, split and description are not sent"), which separates it from sw_update_expense and sw_get_receipt without opening either schema.

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?

It routes the agent among the three ways to supply the file: use upload_id on the hosted server (after sw_get_upload_url) to avoid shipping bytes, path only when SPLITWISE_INPUT_DIR is set locally, base64 as a fallback. It also states the prerequisite confirmation step and what happens in clients that lack elicitation, so there is nothing left to infer.

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