Skip to content

Commit d60b75a

Browse files
authored
fix: add prompt guidance to save_artifact to avoid double-generation (#215)
Instruct the agent to call save_artifact directly with content rather than first outputting it to the conversation and then saving separately, which would regenerate the entire artifact token-by-token.
1 parent 22894f7 commit d60b75a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/toolkits/portal/toolkit.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ func (t *Toolkit) RegisterTools(s *mcp.Server) {
126126
Title: "Save Artifact",
127127
Description: "Saves an AI-generated artifact (JSX dashboard, HTML report, SVG chart, etc.) " +
128128
"to the asset portal for persistence, viewing, and sharing. " +
129+
"IMPORTANT: When creating content that should be saved, call this tool directly with the content " +
130+
"rather than first outputting it to the conversation and then saving separately — " +
131+
"this avoids regenerating the entire artifact. " +
129132
"Automatically captures provenance (which tool calls produced this artifact).",
130133
InputSchema: saveArtifactSchema,
131134
}, t.handleSaveArtifact)

0 commit comments

Comments
 (0)