MCPcopy
hub / github.com/sipeed/picoclaw / largeTextArtifactFallback

Method largeTextArtifactFallback

pkg/tools/integration/mcp_tool.go:483–497  ·  view source on GitHub ↗
(text string, err error)

Source from the content-addressed store, hash-verified

481}
482
483func (t *MCPTool) largeTextArtifactFallback(text string, err error) *ToolResult {
484 size := utf8.RuneCountInString(text)
485 logger.WarnCF("tool", "Failed to persist large MCP text artifact", map[string]any{
486 "server": t.serverName,
487 "tool": t.tool.Name,
488 "chars": size,
489 "error": err.Error(),
490 })
491 return &ToolResult{
492 ForLLM: fmt.Sprintf(
493 "[MCP returned a large text result (%d chars); omitted from model context because artifact persistence failed.]",
494 size,
495 ),
496 }
497}
498
499func (t *MCPTool) storeEmbeddedResource(ctx context.Context, content *mcp.EmbeddedResource) (string, string, string) {
500 if content == nil || content.Resource == nil {

Callers 1

Calls 2

WarnCFFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected