Documentation
¶
Overview ¶
Package handler provides MCP tool handlers for Helm operations.
Index ¶
Constants ¶
const ( MaxResponseTokens = 10_000 MaxResponseBytes = MaxResponseTokens * bytesPerToken )
Token-based response limits. 10K tokens is a practical budget for LLM tool responses; at ~4 bytes/token that translates to 40KB of text content.
Variables ¶
This section is empty.
Functions ¶
func CollapseYAML ¶
func CollapseYAML(data []byte, opts CollapseOptions) (string, bool, error)
CollapseYAML transforms YAML content with depth limiting for progressive disclosure. When depth is limited, nested structures are summarized (e.g., "object (5 keys)"). Returns the original YAML unchanged if MaxDepth is 0 (unlimited).
The second return value indicates whether any collapsing occurred. Returns an error only if the input is not valid YAML.
Types ¶
type CollapseOptions ¶
type CollapseOptions struct {
// MaxDepth controls how many nesting levels to expand before summarizing.
// 0 means unlimited (return full YAML).
MaxDepth int
// MaxArrayItems limits how many array items to show before truncating.
// 0 means unlimited. Default is 3.
MaxArrayItems int
// ShowDefaults includes actual values. When false, shows types only.
ShowDefaults bool
// ShowComments preserves YAML comments in output.
ShowComments bool
}
CollapseOptions controls how YAML is collapsed for progressive disclosure.
Depth semantics for structure { a: { b: { c: value } } }:
MaxDepth=0: Full YAML (unlimited) MaxDepth=1: a: object (1 key) MaxDepth=2: a:\n b: object (1 key) MaxDepth=3: Full expansion to c: value
func DefaultCollapseOptions ¶
func DefaultCollapseOptions() CollapseOptions
DefaultCollapseOptions returns the default options for collapsing YAML.