Every method of client.Template in the Go SDK.
Apply#
Apply a template · tool template_apply
Applies a saved template — or blank, no studies — to a chart or every chart of its workbench, as the templates menu does; what could not be applied is said, one line each. Answers the chart and those lines.
Declaration
client.Template
func (a *TemplateAPI) Apply(ctx context.Context, args TemplateApplyArgs) (any, error)Parameters
| Name | Type | What it is | |
|---|---|---|---|
Chart | string | required | |
AllCharts | *bool | optional | Onto every chart of the chart's workbench, as the menu's All switch. |
Blank | *bool | optional | |
Name | *string | optional | The template's name; absent with blank, which takes every study off. |
Returns
(any, error) — the tool’s answer as maps and slices (any).
What it answers
Answers the chart and those lines.
Example
client.Template.Apply(ctx, mcp.TemplateApplyArgs{Chart: chart})Delete#
Delete a template · tool template_delete
Deletes a saved template, as its row's x and the confirmation do — only with confirm; without it the answer names what would be deleted. Answers the templates.
Declaration
client.Template
func (a *TemplateAPI) Delete(ctx context.Context, args TemplateDeleteArgs) (any, error)Parameters
| Name | Type | What it is | |
|---|---|---|---|
Name | string | required | |
Confirm | *bool | optional | Without it nothing is deleted and the answer says what would be. |
Returns
(any, error) — the tool’s answer as maps and slices (any).
What it answers
Answers the templates.
Example
client.Template.Delete(ctx, mcp.TemplateDeleteArgs{Name: "…"})Rename#
Rename a template · tool template_rename
Renames a saved template, as its gear's Rename does. Answers the templates.
Declaration
client.Template
func (a *TemplateAPI) Rename(ctx context.Context, args TemplateRenameArgs) (any, error)Parameters
| Name | Type | What it is | |
|---|---|---|---|
Name | string | required | |
To | string | required |
Returns
(any, error) — the tool’s answer as maps and slices (any).
What it answers
Answers the templates.
Example
client.Template.Rename(ctx, mcp.TemplateRenameArgs{Name: "…", To: "…"})Save#
Save a template · tool template_save
Saves a chart's studies — and its type and look with with_type — as a named template, as the templates menu's Save does; a name taken or unusable is refused in its words. Answers the templates.
Declaration
client.Template
func (a *TemplateAPI) Save(ctx context.Context, args TemplateSaveArgs) (any, error)Parameters
| Name | Type | What it is | |
|---|---|---|---|
Chart | string | required | The chart whose studies (and, with with_type, type and look) become the template. |
Name | string | required | |
WithType | *bool | optional | The chart's type and look saved with its studies. |
Returns
(any, error) — the tool’s answer as maps and slices (any).
What it answers
Answers the templates.
Example
client.Template.Save(ctx, mcp.TemplateSaveArgs{Chart: chart, Name: "…"})SetDefault#
Set an interval's default template · tool template_set_default
Makes a template the one a new chart of an interval opens with, or takes the default off an interval or off every interval a template is the default of, as the template gear's choices do. Answers the templates.
Declaration
client.Template
func (a *TemplateAPI) SetDefault(ctx context.Context, args TemplateSetDefaultArgs) (any, error)Parameters
| Name | Type | What it is | |
|---|---|---|---|
ClearAll | *bool | optional | Every interval this template is the default of loses it. |
Interval | *string | optional | The interval it opens with, as the menu writes it (M1, H4, D1); absent with clear_all. |
Name | *string | optional | The template, or absent to make the interval open with none. |
Returns
(any, error) — the tool’s answer as maps and slices (any).
What it answers
Answers the templates.
Example
client.Template.SetDefault(ctx, mcp.TemplateSetDefaultArgs{})