MCPcopy Create free account
hub / github.com/compozy/agh / validateMemoryCreateRequest

Function validateMemoryCreateRequest

internal/api/core/memory.go:2086–2097  ·  view source on GitHub ↗
(req contract.MemoryCreateRequest)

Source from the content-addressed store, hash-verified

2084}
2085
2086func validateMemoryCreateRequest(req contract.MemoryCreateRequest) error {
2087 if err := req.Type.Validate(); err != nil {
2088 return NewMemoryValidationError(err)
2089 }
2090 if strings.TrimSpace(req.Name) == "" {
2091 return NewMemoryValidationError(errors.New("name is required"))
2092 }
2093 if strings.TrimSpace(req.Content) == "" {
2094 return NewMemoryValidationError(errors.New("content is required"))
2095 }
2096 return nil
2097}
2098
2099func (h *BaseHandlers) memoryCandidateFromCreate(
2100 selector memorySelector,

Callers 1

WriteMemoryMethod · 0.85

Calls 2

NewMemoryValidationErrorFunction · 0.85
ValidateMethod · 0.65

Tested by

no test coverage detected