Skip to content

feat(config): kbagent config examples — surface component config examples (port get_config_examples) #393

Description

@padak

Part of #390.

Summary

Surface the configuration examples that kbagent already fetches but throws away, porting the get_config_examples MCP tool. This is essentially a reformat-only feature.

MCP source (keboola-mcp-server @ agent-v1.60.0)

  • Tool: src/keboola_mcp_server/tools/components/tools.py (get_config_examples) — calls ai_service_client.get_component_detail(component_id) (the same GET docs/components/{id} endpoint kbagent uses) and reads rootConfigurationExamples / rowConfigurationExamples off the payload.
  • Output: markdown — ## Root Configuration Examples / ## Row Configuration Examples, each example as a numbered json block. No separate endpoint, no static bundle, no cap.

What kbagent already has

  • ai_client.py get_component_detail hits the identical GET /docs/components/{id} endpoint.
  • The ComponentDetail model already parses both example lists (root_configuration_examples / row_configuration_examples, aliased from rootConfigurationExamples / rowConfigurationExamples).
  • But component_service.py get_component_detail discards the bodies and returns only examples_count / row_examples_count; commands/component.py shows just "{N} root config example(s)" and --json carries no example bodies.
  • The full bodies are already consumed internally for scaffold generation — proof the data flows end-to-end.

Proposed command

kbagent config examples --component-id ID [--project NAME] [--row]

(Lives naturally in component group too, since the data source is the component, not a config. component examples is an equally valid placement — decide during implementation. --row filters to row examples.)

Implementation sketch (3-layer)

  • L3 none — reuse get_component_detail.
  • L2 ComponentService.get_config_examples(alias, component_id) → stop discarding the lists; return {component_id, root_examples, row_examples}.
  • L1 thin command; --json emits structured example dicts (more useful to agents than a markdown blob); human renders numbered JSON blocks.

Effort: S (nearly free)

Acceptance criteria

Risks / open questions

  • Decide: new subcommand vs. --examples flag on component detail (recommendation: subcommand — examples can be large/noisy in a summary panel).
  • Dual-output: --json should be structured dicts, not the MCP markdown string. Make this an explicit decision so it isn't cargo-culted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions