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

Function decodeResourceInfoInput

internal/daemon/native_bundle_resource_tools.go:411–429  ·  view source on GitHub ↗
(req toolspkg.CallRequest)

Source from the content-addressed store, hash-verified

409}
410
411func decodeResourceInfoInput(req toolspkg.CallRequest) (resources.ResourceKind, string, error) {
412 var input resourceInfoInput
413 if err := decodeNativeInput(req, &input); err != nil {
414 return "", "", err
415 }
416 kindRaw, err := requiredNativeString(req.ToolID, "kind", input.Kind)
417 if err != nil {
418 return "", "", err
419 }
420 id, err := requiredNativeString(req.ToolID, "id", input.ID)
421 if err != nil {
422 return "", "", err
423 }
424 kind := resources.ResourceKind(kindRaw)
425 if err := kind.Validate("kind"); err != nil {
426 return "", "", nativeResourceToolError(req.ToolID, err)
427 }
428 return kind, id, nil
429}
430
431func resourceScopeFromInput(rawKind string, rawID string, path string) (resources.ResourceScope, bool, error) {
432 if strings.TrimSpace(rawKind) == "" && strings.TrimSpace(rawID) == "" {

Callers 1

resourcesInfoMethod · 0.85

Calls 5

ResourceKindTypeAlias · 0.92
decodeNativeInputFunction · 0.85
requiredNativeStringFunction · 0.85
nativeResourceToolErrorFunction · 0.85
ValidateMethod · 0.65

Tested by

no test coverage detected