Skip to main content
Glama

Set Parameter

set_param

Use this when you need to edit a param() default value in a kernelCAD script. Returns the modified code as text plus diagnostics from re-evaluating the result. Caller persists the new code via standard file-write tools (this tool has no side effects).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe .kcad.ts source code.
new_valueYesThe new default value. Either a number for a numeric param (e.g. 12.5), or a string expression evaluated in the script (e.g. "width/2 + 3").
param_nameYesThe string literal name of the param (first arg to param()).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedOutput schema / properties
      Removed value: -{
      -  "binding_name": {
      -    "description": "JS const name bound to the new construct (when one was created).",
      -    "type": "string"
      -  },
      -  "diagnostics": {
      -    "description": "Diagnostics from re-evaluating the modified source.",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "error": {
      -    "description": "Failure message (present when ok is false).",
      -    "type": "string"
      -  },
      -  "new_code": {
      -    "description": "Modified .kcad.ts source (present on success). Caller persists it.",
      -    "type": "string"
      -  },
      -  "ok": {
      -    "description": "Whether the edit applied and re-evaluated cleanly.",
      -    "type": "boolean"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok"
      -]
  2. Changed3 schema fields changed
    • changedInput schema / properties / new_value / description
      Previous value: -"The new default value — number for numeric params, string for expressions."New value: +"The new default value. Either a number for a numeric param (e.g. 12.5), or a string expression evaluated in the script (e.g. \"width/2 + 3\")."
    • addedInput schema / properties / new_value / examples
      Added value: +[
      +  12.5,
      +  "width/2 + 3"
      +]
    • addedInput schema / properties / new_value / oneOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "binding_name": {
      +      "description": "JS const name bound to the new construct (when one was created).",
      +      "type": "string"
      +    },
      +    "diagnostics": {
      +      "description": "Diagnostics from re-evaluating the modified source.",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "error": {
      +      "description": "Failure message (present when ok is false).",
      +      "type": "string"
      +    },
      +    "new_code": {
      +      "description": "Modified .kcad.ts source (present on success). Caller persists it.",
      +      "type": "string"
      +    },
      +    "ok": {
      +      "description": "Whether the edit applied and re-evaluated cleanly.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  4. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.