---
title: "Stage one file upsert or delete inside a change set"
method: POST
path: "/api/mcp/tools/add_file_change"
tags: ["tools"]
---

# Stage one file upsert or delete inside a change set

`POST /api/mcp/tools/add_file_change`

## Request

- Base URL: `https://finestructure.ai`
- URL: `https://finestructure.ai/api/mcp/tools/add_file_change`
- Auth: HTTP bearer

Stage one file upsert or delete inside a change set. Does not modify the live app until apply_change_set. Paths follow the Fine Structure app file API, documented at https://finestructure.ai/api/mcp/docs.

## Request body

- object
  - `app_id` string, required: The app ID
  - `change_set_id` string, required: Change set ID
  - `path` string, required: Virtual file path
  - `content` string: Complete file contents for upsert
  - `file_type` string: Optional file type override
  - `operation` 'upsert' | 'delete'

## Response `200`

Tool executed successfully

- ToolResult
  - `ok` boolean, required
  - `tool` string, required
  - `result` object, required

## Other responses

- `400`: Invalid arguments for this tool
- `401`: Missing or invalid bearer token
- `402`: Not enough credits on the account
- `403`: Token scope does not permit this tool
- `404`: Unknown tool name
- `429`: Rate limit exceeded, retry after the indicated delay
- `500`: Internal error while executing the tool

---

[API](https://skmtc.dev/finestructure/apis/fine-structure-api.md) · [All operations](https://skmtc.dev/finestructure/apis/fine-structure-api/llms.txt) · [OpenAPI document](https://skmtc.dev/finestructure/apis/fine-structure-api/revisions/02c50ed5fd70?raw)
