MCPcopy Index your code
hub / github.com/modelcontextprotocol/registry / validateArgument

Function validateArgument

internal/validators/validators.go:396–409  ·  view source on GitHub ↗

validateArgument validates argument details

(ctx *ValidationContext, obj *model.Argument)

Source from the content-addressed store, hash-verified

394
395// validateArgument validates argument details
396func validateArgument(ctx *ValidationContext, obj *model.Argument) *ValidationResult {
397 result := &ValidationResult{Valid: true, Issues: []ValidationIssue{}}
398
399 if obj.Type == model.ArgumentTypeNamed {
400 // Validate named argument name format
401 nameResult := validateNamedArgumentName(ctx.Field("name"), obj.Name)
402 result.Merge(nameResult)
403
404 // Validate value and default don't start with the name
405 valueResult := validateArgumentValueFields(ctx, obj.Name, obj.Value, obj.Default)
406 result.Merge(valueResult)
407 }
408 return result
409}
410
411func validateNamedArgumentName(ctx *ValidationContext, name string) *ValidationResult {
412 result := &ValidationResult{Valid: true, Issues: []ValidationIssue{}}

Callers 1

validatePackageFieldFunction · 0.85

Calls 4

MergeMethod · 0.95
FieldMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…