set_project_setting
Edit a single project.godot setting without launching Godot. Writes one section/key value or literal in place, preserving all other lines, and returns the read-back value.
Instructions
Set one project.godot setting without launching Godot. Pass value (JSON, converted to a Godot literal) or literal (raw Godot text, e.g. "Vector2i(1280, 720)"), not both. Rewrites the last assignment in place or adds key/section; other lines stay byte for byte. Refuses autoload/* (use the autoload tools). Returns: { section, key, value read back, created, sectionCreated, previous? }.
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": {
"projectPath": "<projectPath>",
"section": "<section>",
"key": "<key>"
},
"name": "set_project_setting"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Setting key within the section, e.g. "window/size/viewport_width". Same character set as section. | |
| value | No | JSON value converted to a Godot literal: a string is quoted, an integer-valued number is an int (write 2 as literal "2.0" for a float), a boolean is true/false, an array becomes [a, b], an object a dictionary. null is not accepted; use literal "null". | |
| literal | No | Raw Godot literal written as is, on one line, with no trailing comment: "str", 1.5, true, null, [1, 2], {"a": 1} or a constructor such as Vector2i(1, 2) or PackedStringArray("a"). Checked by reading it back as one complete value. Resource(...), Object(...), ExtResource(...) and SubResource(...) are refused: Godot may then fail to load project.godot. | |
| section | Yes | INI section, e.g. "display" or "application". Letters, digits and _ . - /, no spaces. | |
| projectPath | Yes | Path to the Godot project directory |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | ||
| value | Yes | The setting as get_project_settings reads it back after the write: a string unescaped, a number or boolean typed, anything else its raw text. | |
| created | Yes | True when the key was added, false when an existing assignment was rewritten. | |
| section | Yes | ||
| previous | No | The value that was replaced; absent when created. | |
| warnings | No | Present only when there is something to say, e.g. project.godot has lines not in the form Godot writes. | |
| sectionCreated | Yes | True when the section did not exist and was appended. |