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

Function parseToolInputJSON

internal/cli/tool_operator.go:442–452  ·  view source on GitHub ↗
(field string, raw string)

Source from the content-addressed store, hash-verified

440}
441
442func parseToolInputJSON(field string, raw string) (json.RawMessage, error) {
443 trimmed := strings.TrimSpace(raw)
444 if trimmed == "" {
445 return nil, toolspkg.NewValidationError(field, toolspkg.ReasonSchemaInvalid, "input JSON is required")
446 }
447 var compacted bytes.Buffer
448 if err := json.Compact(&compacted, []byte(trimmed)); err != nil {
449 return nil, toolspkg.NewValidationError(field, toolspkg.ReasonSchemaInvalid, "input must be valid JSON")
450 }
451 return json.RawMessage(compacted.String()), nil
452}
453
454func writeToolCommandError(cmd *cobra.Command, err error) error {
455 if err == nil {

Callers 3

resolveToolInvokeInputFunction · 0.85
resolveToolApprovalInputFunction · 0.85
readToolInputFileFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected