Update a spec file
updateSpecFileUpdate an OpenAPI or protobuf 2/3 specification file by changing its content, name, or file type (ROOT/DEFAULT).
Instructions
Updates a file for an OpenAPI or protobuf 2 or 3 specification.
Note:
This endpoint does not accept an empty request body. You must pass one of the accepted values.
This endpoint does not accept multiple request body properties in a single call. For example, you cannot pass both the `content` and `type` property at the same time.
Multi-file specifications can only have one root file.
When updating a file type to `ROOT`, the previous root file is updated to the `DEFAULT` file type.
Files cannot exceed a maximum of 10 MB in size.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"specId": "<specId>",
"filePath": "<filePath>"
},
"name": "updateSpecFile"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | The file's name. | |
| type | No | The type of file: - `ROOT` — The file containing the full OpenAPI structure. This serves as the entry point for the API spec and references other (`DEFAULT`) spec files. Multi-file specs can only have one root file. - `DEFAULT` — A file referenced by the `ROOT` file. | |
| specId | Yes | The spec's ID. | |
| content | No | The specification's stringified contents. | |
| filePath | Yes | The path to the file. |