@@ -26,18 +26,14 @@ import (
|
||||
func LoggingMiddleware(logger *log.Logger) func(mcp.MethodHandler) mcp.MethodHandler {
|
||||
return func(next mcp.MethodHandler) mcp.MethodHandler {
|
||||
return func(ctx context.Context, method string, req mcp.Request) (mcp.Result, error) {
|
||||
sessionID := req.GetSession().ID()
|
||||
|
||||
logger.InfoCtx(ctx, fmt.Sprintf("mcp %q method started", method),
|
||||
log.String("method", method),
|
||||
log.String("session_id", sessionID),
|
||||
log.Bool("has_params", req.GetParams() != nil),
|
||||
)
|
||||
|
||||
if ctr, ok := req.(*mcp.CallToolRequest); ok {
|
||||
logger.InfoCtx(ctx, fmt.Sprintf("calling %q tool", ctr.Params.Name),
|
||||
log.String("tool_name", ctr.Params.Name),
|
||||
log.String("session_id", sessionID),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -48,7 +44,6 @@ func LoggingMiddleware(logger *log.Logger) func(mcp.MethodHandler) mcp.MethodHan
|
||||
if err != nil {
|
||||
logger.ErrorCtx(ctx, fmt.Sprintf("mcp %q method failed", method),
|
||||
log.String("method", method),
|
||||
log.String("session_id", sessionID),
|
||||
log.Int64("duration_ms", duration.Milliseconds()),
|
||||
log.Error(err),
|
||||
)
|
||||
@@ -56,14 +51,12 @@ func LoggingMiddleware(logger *log.Logger) func(mcp.MethodHandler) mcp.MethodHan
|
||||
|
||||
logger.InfoCtx(ctx, fmt.Sprintf("mcp %q method completed", method),
|
||||
log.String("method", method),
|
||||
log.String("session_id", sessionID),
|
||||
log.Int64("duration_ms", duration.Milliseconds()),
|
||||
log.Bool("has_result", result != nil),
|
||||
)
|
||||
|
||||
if ctr, ok := result.(*mcp.CallToolResult); ok {
|
||||
logger.InfoCtx(ctx, "tool call result",
|
||||
log.String("session_id", sessionID),
|
||||
log.Bool("is_error", ctr.IsError),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ func (r *resolver) AddVendor(
|
||||
BusinessAssociateAgreementURL: args.BusinessAssociateAgreementURL,
|
||||
SubprocessorsListURL: args.SubprocessorsListURL,
|
||||
Certifications: args.Certifications,
|
||||
Countries: args.Countries,
|
||||
SecurityPageURL: args.SecurityPageURL,
|
||||
TrustPageURL: args.TrustPageURL,
|
||||
TermsOfServiceURL: args.TermsOfServiceURL,
|
||||
|
||||
@@ -30,10 +30,8 @@ var (
|
||||
Description: "List all organizations the user has access to",
|
||||
Annotations: &mcp.ToolAnnotations{ReadOnlyHint: true},
|
||||
InputSchema: &jsonschema.Schema{
|
||||
Type: "object",
|
||||
Properties: map[string]*jsonschema.Schema{
|
||||
"organizationID": {Type: "string"},
|
||||
},
|
||||
Type: "object",
|
||||
Properties: map[string]*jsonschema.Schema{},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -103,19 +103,19 @@ type (
|
||||
var (
|
||||
ListVendorsInputSchema = &jsonschema.Schema{
|
||||
Type: "object",
|
||||
Required: []string{"organizationID"},
|
||||
Required: []string{"organization_id"},
|
||||
Properties: map[string]*jsonschema.Schema{
|
||||
"organizationID": {Type: "string"},
|
||||
"organization_id": {Type: "string"},
|
||||
"filter": {
|
||||
Type: "object",
|
||||
Properties: map[string]*jsonschema.Schema{
|
||||
"snapshotID": {Type: "string"},
|
||||
"snapshot_id": {Type: "string"},
|
||||
},
|
||||
},
|
||||
"orderBy": {
|
||||
"order_field": {
|
||||
Types: []string{"object", "null"},
|
||||
Properties: map[string]*jsonschema.Schema{
|
||||
"field": {Type: "string", Enum: []any{"CREATED_AT"}},
|
||||
"field": {Type: "string", Enum: []any{"CREATED_AT", "UPDATED_AT", "NAME"}},
|
||||
"direction": OrderByDirectionSchema,
|
||||
},
|
||||
},
|
||||
@@ -170,7 +170,7 @@ var (
|
||||
"description": NullableStringSchema,
|
||||
"category": VendorCategorySchema,
|
||||
"headquarter_address": NullableStringSchema,
|
||||
"legalName": NullableStringSchema,
|
||||
"legal_name": NullableStringSchema,
|
||||
"website_url": NullableStringSchema,
|
||||
"privacy_policy_url": NullableStringSchema,
|
||||
"service_level_agreement_url": NullableStringSchema,
|
||||
|
||||
Reference in New Issue
Block a user