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

Function artifactListResult

packages/hosts/mcp/src/tool-server.ts:1213–1231  ·  view source on GitHub ↗
(artifacts: readonly ArtifactSummary[])

Source from the content-addressed store, hash-verified

1211});
1212
1213const artifactListResult = (artifacts: readonly ArtifactSummary[]): McpToolResult => {
1214 const items = artifacts.map((artifact) => ({
1215 id: artifact.id,
1216 title: artifact.title,
1217 description: artifact.description,
1218 updatedAt: artifact.updatedAt.toISOString(),
1219 }));
1220 const text =
1221 items.length === 0
1222 ? "No saved artifacts yet. Use create-artifact to make one."
1223 : [
1224 "Saved artifacts:",
1225 ...items.map(
1226 (item) =>
1227 `- ${item.id} — ${item.title}${item.description ? `: ${item.description}` : ""} (updated ${item.updatedAt})`,
1228 ),
1229 ].join("\n");
1230 return { content: [{ type: "text", text }], structuredContent: { artifacts: items } };
1231};
1232
1233const artifactNotFoundResult = (id: string): McpToolResult => ({
1234 content: [

Callers 1

listArtifactsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected