MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / renderedInAppResult

Function renderedInAppResult

packages/hosts/mcp/src/tool-server.ts:904–929  ·  view source on GitHub ↗
(input: {
  readonly code: string;
  readonly artifactId: string;
  readonly title: string;
  readonly url?: string | undefined;
})

Source from the content-addressed store, hash-verified

902});
903
904const renderedInAppResult = (input: {
905 readonly code: string;
906 readonly artifactId: string;
907 readonly title: string;
908 readonly url?: string | undefined;
909}): McpToolResult => ({
910 content: [
911 {
912 type: "text",
913 text: [
914 `Rendered "${input.title}" as an interactive UI component. Saved as artifact ${input.artifactId}.`,
915 // The link rides along even though the widget rendered: clients lose
916 // rendered widgets in ways the server never sees (a transcript
917 // reopened without re-reading the ui:// resource shows raw JSON), and
918 // when that happens this URL in the conversation is the only path
919 // back to the artifact the model can offer.
920 ...(input.url ? [`It also stays available at ${input.url}`] : []),
921 ].join("\n"),
922 },
923 ],
924 structuredContent: {
925 code: input.code,
926 artifactId: input.artifactId,
927 ...(input.url ? { url: input.url } : {}),
928 },
929});
930
931const renderedAsLinkResult = (input: {
932 readonly url: string;

Callers 1

deliverArtifactFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected