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

Function makeToolCallEntry

packages/cli/src/commands/migrate.ts:360–385  ·  view source on GitHub ↗
(
    tool: { callId: string; name: string; input: unknown },
    timestamp: string,
    parentId: string | null,
    usage: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

358}
359
360function makeToolCallEntry(
361 tool: { callId: string; name: string; input: unknown },
362 timestamp: string,
363 parentId: string | null,
364 usage: Record<string, unknown>,
365): PiJson {
366 return {
367 type: "message",
368 id: shortId(),
369 parentId,
370 timestamp,
371 message: {
372 role: "assistant",
373 content: [
374 {
375 type: "toolCall",
376 id: tool.callId,
377 name: tool.name,
378 arguments: tool.input ?? {},
379 },
380 ],
381 timestamp: Date.parse(timestamp),
382 usage,
383 },
384 };
385}
386
387function makeToolResultEntry(
388 tool: { callId: string; name: string; output: unknown },

Callers 1

convertPartToEntriesFunction · 0.85

Calls 1

shortIdFunction · 0.85

Tested by

no test coverage detected