Skip to content

Commit 2f22a43

Browse files
committed
Fix for the MCP tool that gets logs for debugging runs
This was broken when we changed the data on the backend that returns log/span data from runs. We changed the data structured and the internal API that the MCP client uses was failing to parse with the Zod schema
1 parent 9fdf91a commit 2f22a43

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.changeset/fuzzy-wolves-repeat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Fix for the MCP tool that gets run logs to help debugging

packages/cli-v3/src/mcp/formatters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function formatSpan(
238238
const duration = formatDuration(span.data.duration);
239239
const startTime = formatDateTime(span.data.startTime);
240240

241-
lines.push(`${indent}${prefix} ${span.message} ${statusIndicator}`);
241+
lines.push(`${indent}${prefix} ${span.data.message} ${statusIndicator}`);
242242
lines.push(`${indent} Duration: ${duration}`);
243243
lines.push(`${indent} Started: ${startTime}`);
244244

packages/core/src/v3/schemas/api.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,9 +1267,9 @@ export type ApiBranchListResponseBody = z.infer<typeof ApiBranchListResponseBody
12671267
export const RetrieveRunTraceSpanSchema = z.object({
12681268
id: z.string(),
12691269
parentId: z.string().optional(),
1270-
message: z.string(),
1270+
runId: z.string(),
12711271
data: z.object({
1272-
runId: z.string(),
1272+
message: z.string(),
12731273
taskSlug: z.string().optional(),
12741274
taskPath: z.string().optional(),
12751275
events: z.array(z.any()).optional(),
@@ -1279,7 +1279,6 @@ export const RetrieveRunTraceSpanSchema = z.object({
12791279
isPartial: z.boolean(),
12801280
isCancelled: z.boolean(),
12811281
level: z.string(),
1282-
environmentType: z.string(),
12831282
workerVersion: z.string().optional(),
12841283
queueName: z.string().optional(),
12851284
machinePreset: z.string().optional(),

0 commit comments

Comments
 (0)