---
title: "Rename or move one app source file atomically"
method: POST
path: "/api/mcp/tools/rename_app_file"
tags: ["tools"]
---

# Rename or move one app source file atomically

`POST /api/mcp/tools/rename_app_file`

## Request

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

Rename or move one app source file atomically. Internally stages an upsert at new_path and a delete at old_path, validates the resulting app state, and creates a Saved Version before applying.

## Request body

- object
  - `app_id` string, required: The app ID
  - `old_path` string, required: Existing virtual file path to rename
  - `new_path` string, required: New virtual file path
  - `overwrite` boolean: Allow replacing an existing file at new_path
  - `force` boolean: Apply even if validation reports blocking errors

## 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)
