Skip to content

[Code Quality] Add examples to main schema env field for improved IDE support #13040

@github-actions

Description

@github-actions

Description

The Cross-Schema Consistency Analysis - 2026-01-31 found that the main workflow schema's stdio_mcp_tool.properties.env field lacks examples, while the MCP config schema includes comprehensive examples. This reduces IDE autocomplete discoverability.

Current State

Main schema (pkg/parser/schemas/main_workflow_schema.json):

{
  "type": "object",
  "patternProperties": {
    "^[A-Z_][A-Z0-9_]*$": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "description": "Environment variables for MCP server"
}

MCP config schema (includes examples):

{
  "type": "object",
  "patternProperties": {
    "^[A-Z_][A-Z0-9_]*$": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "description": "Environment variables for MCP server",
  "examples": [
    {"GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}"},
    {"API_KEY": "${{ secrets.CUSTOM_API_KEY }}", "LOG_LEVEL": "debug"},
    {"BRAVE_API_KEY": "${{ secrets.BRAVE_API_KEY }}"}
  ]
}

Suggested Changes

Add the same examples array from the MCP config schema to the main schema's env field definition.

Files Affected

  • pkg/parser/schemas/main_workflow_schema.json (line for stdio_mcp_tool.properties.env)

Success Criteria

  • Main schema includes examples array for env field
  • Examples show common patterns (secrets, debug flags)
  • IDE autocomplete suggests example environment variables
  • Schema remains valid JSON Schema Draft 7
  • All existing workflows continue to validate successfully

Benefits

  • Improved developer experience in IDEs with JSON Schema support
  • Better discoverability of environment variable configuration
  • Consistency between main schema and MCP config schema
  • Helps new users understand expected formats

Priority

Low - Improves developer experience but doesn't affect functionality. Quick win for better IDE integration.

Source

Extracted from Cross-Schema Consistency Analysis - 2026-01-31 #13018 - marked as "Priority 1: Add Examples to Main Schema"

Note: Remember to run make build after modifying the schema since schemas are embedded using //go:embed directives.

Estimated Effort: 15-30 minutes

AI generated by Discussion Task Miner - Code Quality Improvement Agent

  • expires on Feb 15, 2026, 5:31 AM UTC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions