Class MCPArtifact

All Implemented Interfaces:
Artifact

@TypeAlias("mcp") public class MCPArtifact extends AbstractArtifact
Generic artifact wrapping an MCP tool's structured response. Behaves like every other artifact: registered in the ArtifactRegistry on serialization, replaced by its ref in LLM-facing output, fetchable by ref via the existing artifact tools.

The walker that produces this artifact is responsible for two things:

  1. Recursively wrapping non-trivial sub-objects in their own MCPArtifact instances and embedding them as values in data. The framework's artifact-ref serializer collapses each nested instance to its own ref in LLM-facing serialization.
  2. Pre-populating the inherited summaryCache (via AbstractArtifact.cacheSummary(String, ai.redouble.nucleo.harness.schema.SummarizedField)) for long string and binary leaves, keyed by JSON pointer into data (e.g. /results/0/fullText).

The data field carries @LLMSummarizable(preSummarized=true) so the framework's serializer walks the tree and renders the cached summary at any leaf where an entry exists, raw value otherwise. No MCP-specific serialization code path needed.

Since:
0.1 (2026-05-09)
Author:
Andrey Santrosyan
  • Constructor Details

    • MCPArtifact

      public MCPArtifact()
  • Method Details

    • getData

      public Map<String,Object> getData()
    • setData

      public void setData(Map<String,Object> data)
    • getMcpHandle

      public String getMcpHandle()
    • setMcpHandle

      public void setMcpHandle(String mcpHandle)
    • getToolName

      public String getToolName()
    • setToolName

      public void setToolName(String toolName)