MCPcopy Create free account
hub / github.com/cortexkit/magic-context / makeToolResultEntry

Function makeToolResultEntry

packages/cli/src/commands/migrate.ts:387–406  ·  view source on GitHub ↗
(
    tool: { callId: string; name: string; output: unknown },
    timestamp: string,
    parentId: string | null,
)

Source from the content-addressed store, hash-verified

385}
386
387function makeToolResultEntry(
388 tool: { callId: string; name: string; output: unknown },
389 timestamp: string,
390 parentId: string | null,
391): PiJson {
392 return {
393 type: "message",
394 id: shortId(),
395 parentId,
396 timestamp,
397 message: {
398 role: "toolResult",
399 toolCallId: tool.callId,
400 toolName: tool.name,
401 content: [{ type: "text", text: textFromUnknown(tool.output) }],
402 isError: false,
403 timestamp: Date.parse(timestamp),
404 },
405 };
406}
407
408interface ConvertPartContext {
409 role: "user" | "assistant";

Callers 1

convertPartToEntriesFunction · 0.85

Calls 2

shortIdFunction · 0.85
textFromUnknownFunction · 0.85

Tested by

no test coverage detected