> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: "updateCodeFile"
sidebarTitle: "updateCodeFile"
description: "Update the content of an existing code file. This will replace the entire content of the file. The file will be automatically linted and type-checked after update."
tag: "TOOL"
tagColor: "purple"
gridGap: 30
---

<Aside full>
  <RequestExample>
    ```json lines=false
    {
      "method": "tools/call",
      "params": {
        "name": "updateCodeFile",
        "arguments": {
          "codeFileId": "string",
          "content": "string"
        }
      }
    }
    ```
  </RequestExample>
</Aside>

<MCPTool {...{"name":"updateCodeFile","description":"Update the content of an existing code file.\n\nThis will replace the entire content of the file.\nThe file will be automatically linted and type-checked after update.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"codeFileId":{"type":"string","description":"The ID of the code file to update"},"content":{"type":"string","description":"The new TypeScript/React code content"}},"required":["codeFileId","content"],"additionalProperties":false},"annotations":{"idempotentHint":true}}} />
