Skip to content

feat: Add dashboard builder tools with validation framework#81

Open
daniel-edgedelta wants to merge 10 commits into
mainfrom
002-dashboard-builder-tools
Open

feat: Add dashboard builder tools with validation framework#81
daniel-edgedelta wants to merge 10 commits into
mainfrom
002-dashboard-builder-tools

Conversation

@daniel-edgedelta
Copy link
Copy Markdown

Summary

  • Add 6 new MCP tools for complete dashboard lifecycle management
    • CRUD tools: create_dashboard, update_dashboard, delete_dashboard for direct API-backed dashboard operations
    • Builder workflow: get_dashboard_schema, create_widget, assemble_dashboard providing a guided 3-step process for LLM-friendly dashboard construction
  • Add validation framework (pkg/tools/validation/) with 8 rules: version check, root widget existence, unique IDs, widget type validation, variable reference integrity, grid overlap detection, hierarchy cycle detection, and markdown content sanitization
  • Support all 26 v4 widget types across 5 categories (timeseries, scalar, aggregates, other, layout) with cross-parameter validation
  • Update README with Available Tools documentation section

Test plan

  • go build ./... passes clean
  • go fmt ./... passes clean
  • go test -v ./... — all 28 validation tests pass
  • Manual integration test: create dashboard via create_widget + assemble_dashboard workflow
  • Manual integration test: CRUD operations via create_dashboard, update_dashboard, delete_dashboard
  • Verify tools register correctly in MCP client (e.g., Claude Desktop)

Add 6 new MCP tools for dashboard management:
- CRUD tools: create_dashboard, update_dashboard, delete_dashboard
- Builder workflow: get_dashboard_schema, create_widget, assemble_dashboard

The builder workflow provides a guided 3-step process for LLM-friendly
dashboard construction with cross-parameter validation, v4 schema
support for all 26 widget types, and an 8-rule validation framework
covering version checks, unique IDs, grid overlap detection, hierarchy
cycle detection, variable reference integrity, and content sanitization.
- Fix metric queries using {*} instead of variable references
- Fix group_by silently dropped for metric data sources
- Add buildFilterFromVariables() to construct CQL filters from dashboard variables
- Thread rawVariables through buildV4Widgets -> buildVisuals call chain
- Add custom grid positioning (column, column_span, row, row_span) to WidgetConfig
- Rewrite buildV4Widgets to use custom positions with auto-layout fallback
- Calculate root grid rows from actual widget extents
- Update create_widget tool with position parameters
- Update schema examples with new position fields
- Refactor validation rules for cleaner error handling
- Add 24 unit tests: query building, variable filters, custom positioning
Add save_pipeline tool wrapping existing SavePipeline() with guidance
pointing to deploy_pipeline as next step. Add get_lookups,
create_lookup, and update_lookup tools using multipart/form-data file
upload matching the /v1/orgs/{orgID}/lookup_tables API.

All tools tested against live API with JSON schema CSV content.
The EdgeDelta API requires version: v3, ed_self_telemetry_input node,
and links: (not routing:) in all pipeline YAML. Updated the tool
description so LLM callers know the requirements upfront.
Include all pipeline validation rules from the EdgeDelta pipelines
skill: settings.tag required, sequence-compatible processors only,
final/deotel ordering, persisting_cursor_settings warning, Unicode
and json_field_path restrictions, link reference validation.
…ipeline

Client-side YAML validation catches common v3 format errors before
hitting the API, replacing cryptic 500s with actionable messages.
Validates version, settings.tag, required nodes, field names,
headers format, sequence processors, link references, and more.
- get_pipeline_history: strip full YAML content from entries (108KB→1.4KB),
  add limit parameter (default 5, max 50)
- save_pipeline: add node type field reference for http_pull_input,
  http_workflow_input, and lookup processor with correct field names
- pipeline_validation: fix http_workflow_input fields (steps not
  initial_request, workflow_pull_interval not interval), add
  initial_request and log_level to common field mistakes
- Fix remaining %v→%w error wrapping in pipelines.go
Adds optional deploy=true parameter that automatically deploys after
saving, eliminating the 3-step save→get_history→deploy workflow.
On deploy failure, save still succeeds and error is returned in
the response for manual retry.
Replace hand-curated list with the exact 23 processors from
configv3/config_validation.go validateSequenceNode(). Adds lookup,
suppress, split_with_delimiter, extract_json_field, tail_sample,
ottl_context_filter, compound, quota, rate_limit, cumulative_to_delta.
Removes incorrect entries that aren't in the backend validator.
…r tools

VS Code MCP client validates tool schemas strictly per JSON Schema spec.
Array-type parameters without an 'items' field fail validation with:
  "tool parameters array type must have items"

Five WithArray calls in dashboard_builder.go were missing items:
- create_widget: group_by, tab_labels → WithStringItems()
- assemble_dashboard: widgets, variables → Items({"type":"object"})
- assemble_dashboard: tags → WithStringItems()

No behavior change — schema metadata fix only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant