Skip to content

Commit 3f841a9

Browse files
committed
feat(ci): update
1 parent 21de68f commit 3f841a9

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.github/workflows/snapshot.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
-count=1 \
2929
-vet=all \
3030
-timeout 3m \
31-
{{.CLI_ARGS}} \
3231
-coverpkg=./... \
3332
-covermode=atomic \
3433
-coverprofile=coverage.out \

pkg/server/server.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,27 @@ func NewServer(
7575

7676
// Configure logging hooks to track tool calls and errors
7777
hooks := &mcpserver.Hooks{}
78-
hooks.AddBeforeCallTool(func(id any, message *mcp.CallToolRequest) {
79-
logger.Debug(
78+
hooks.AddBeforeCallTool(func(ctx context.Context, id any, message *mcp.CallToolRequest) {
79+
logger.DebugContext(
80+
ctx,
8081
"received tool call request",
8182
slog.Any("id", id),
8283
slog.String("tool", message.Params.Name),
8384
slog.Any("arguments", message.Params.Arguments),
8485
)
8586
})
86-
hooks.AddAfterCallTool(func(id any, message *mcp.CallToolRequest, result *mcp.CallToolResult) {
87-
logger.Info(
87+
hooks.AddAfterCallTool(func(ctx context.Context, id any, message *mcp.CallToolRequest, result *mcp.CallToolResult) {
88+
logger.InfoContext(
89+
ctx,
8890
"tool call finished",
8991
slog.Any("id", id),
9092
slog.String("tool", message.Params.Name),
9193
slog.Any("any", result.Result),
9294
)
9395
})
94-
hooks.AddOnError(func(id any, method mcp.MCPMethod, message any, err error) {
95-
logger.Error(
96+
hooks.AddOnError(func(ctx context.Context, id any, method mcp.MCPMethod, message any, err error) {
97+
logger.ErrorContext(
98+
ctx,
9699
"error occurred",
97100
slog.Any("id", id),
98101
slog.String("method", string(method)),

0 commit comments

Comments
 (0)