pine_save
Save and commit the current Pine Script indicator, then reload it on the chart with one action.
Instructions
Save the current Pine script (commits + reloads the indicator on the chart).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/pine.ts:108-129 (handler)The pineSave function is the actual handler. It accepts an empty input object, calls page.savePine() on the TradingView page, and returns {ok: true}. On failure, it throws a ToolExecutionError with the name 'pine_save'.
// ----------------------------------------------------------------------------- // pine_save // ----------------------------------------------------------------------------- export const pineSaveInput = z.object({}).strict(); export const pineSaveOutput = z.object({ ok: z.literal(true) }); export async function pineSave( _input: z.infer<typeof pineSaveInput>, page: TradingViewPage, ): Promise<z.infer<typeof pineSaveOutput>> { try { await page.savePine(); return { ok: true }; } catch (cause) { throw new ToolExecutionError( 'pine_save', 'Failed to save Pine script.', cause, ); } } - src/tools/pine.ts:112-113 (schema)Zod schema definitions for pine_save: pineSaveInput (empty object, strict) and pineSaveOutput ({ok: z.literal(true)}).
export const pineSaveInput = z.object({}).strict(); export const pineSaveOutput = z.object({ ok: z.literal(true) }); - src/tools/index.ts:133-140 (registration)Registration of the 'pine_save' tool in the TOOLS array with name, description, input/output schemas, and handler reference.
{ name: 'pine_save', description: 'Save the current Pine script (commits + reloads the indicator on the chart).', input: pineSaveInput, output: pineSaveOutput, handler: pineSave, }, - src/tools/index.ts:30-32 (helper)Import re-export of pineSave, pineSaveInput, pineSaveOutput from pine.ts into the tools index for registration.
pineSave, pineSaveInput, pineSaveOutput,