Skip to content

Commit 50ff2b2

Browse files
committed
formatting
1 parent 1620fe5 commit 50ff2b2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

contrib/mark3labs/mcp-go/tracing.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,15 @@ var toolHandlerMiddleware = func(next server.ToolHandlerFunc) server.ToolHandler
5858
}
5959

6060
tagWithSessionID(ctx, toolSpan)
61-
6261
toolSpan.AnnotateTextIO(string(inputJSON), outputText)
6362

64-
// There are two ways a tool can express an error.
65-
66-
// It can return a Go error.
63+
// There are two ways a tool can express an error:
64+
// 1. It can return a Go error.
65+
// 2. It can return IsError: true as part of the tool result.
6766
if err != nil {
6867
toolSpan.Finish(llmobs.WithError(err))
69-
70-
// It can return IsError: true as part of the tool result.
7168
} else if result != nil && result.IsError {
7269
toolSpan.Finish(llmobs.WithError(errors.New("tool resulted in an error")))
73-
7470
} else {
7571
toolSpan.Finish()
7672
}

0 commit comments

Comments
 (0)