Per-flag jsonschema override annotation for complex types #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally filed by @coilysiren on 2026-05-13T14:20:02Z - https://github.com/coilysiren/cli-mcp/issues/35
njayp/ophis supports a
jsonschemaannotation on individual flags: "the JSON string representation of the schema" for complex types beyond the bool/int/float/string/array/duration mapping.cli-mcp today maps urfave flag types to JSON Schema primitives. There's no escape hatch for a flag whose value is parsed as a string but represents a structured payload (JSON config blob, enum with constrained values, regex-bounded string, etc).
Proposal: relay a known
cli.Flagmetadata key (e.g.jsonschemaorclimcp.schema) into the property's JSON schema, overriding the inferred shape. Consistent with how cli-mcp already relayswebops.*metadata ontotool.Meta/tool.Annotations.Open questions:
map[string]any(typed but verbose)?type, or full property replacement (incl.enum,pattern,description)?