set_angle_mode
Set the global trigonometric angle mode for calculations. Choose radians or degrees, individual function calls can override with a unit parameter.
Instructions
Set global trig angle mode. Individual calls with unit param override this.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes |
Implementation Reference
- cruncher.js:2014-2018 (handler)The handler function that executes the set_angle_mode tool logic. Sets the global angleMode variable (line 109) to the provided mode ('degrees' or 'radians') and returns a confirmation message.
/** Set the global angle mode. */ set_angle_mode: ({ mode }) => { angleMode = mode; return `Angle mode set to ${mode}`; }, - cruncher.js:994-1011 (schema)The input schema and tool definition for set_angle_mode. Defines the tool metadata (title, annotations, description) and inputSchema with a required 'mode' parameter constrained to enum ['degrees', 'radians'].
{ name: "set_angle_mode", annotations: { title: "Set Angle Mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, description: "Set global trig angle mode. Individual calls with unit param override this.", inputSchema: { type: "object", properties: { mode: { type: "string", enum: ["degrees", "radians"] } }, required: ["mode"] } }, - cruncher.js:136-138 (registration)set_angle_mode is registered as a main-thread instant tool (no worker overhead) in the MAIN_THREAD_TOOLS Set, ensuring it runs synchronously without spawning a worker.
const MAIN_THREAD_TOOLS = new Set([ // Angle management "set_angle_mode", "get_angle_mode", - cruncher.js:81-81 (registration)set_angle_mode is included in the 'standard' tool tier, meaning it is available by default when CRUNCHER_TOOL_SET is 'standard'.
"set_angle_mode", "get_angle_mode", - cruncher.js:108-109 (helper)The global angleMode state variable that set_angle_mode modifies. Defaults to 'degrees'.
// --- Angle Mode State --- let angleMode = "degrees"; // Default unit for trigonometric functions