Skip to content

feat: add IDE-support tools to MCP server#207

Merged
intel352 merged 2 commits intomainfrom
worktree-agent-a7d337ee
Feb 27, 2026
Merged

feat: add IDE-support tools to MCP server#207
intel352 merged 2 commits intomainfrom
worktree-agent-a7d337ee

Conversation

@intel352
Copy link
Contributor

Summary

  • get_module_schema — returns full ModuleSchema (config fields, types, descriptions, defaults, inputs/outputs) for a given module type
  • get_step_schema — returns step type description, config keys with types/descriptions, example YAML
  • get_template_functions — returns all 10 template functions with signatures, descriptions, examples
  • validate_template_expressions — validates pipeline template expressions for forward refs, self-refs, undefined steps, hyphenated dot-access
  • get_config_examples — lists/returns example config files from the example/ directory

Test plan

  • 30 tests covering all 5 tools (happy path + error/edge cases)
  • golangci-lint clean

🤖 Generated with Claude Code

…dation tools to MCP server

Adds five new tools to the workflow MCP server to help IDE AI assistants author
and validate workflow YAML configurations with accurate, schema-driven knowledge:

- get_module_schema: returns full ModuleSchema for a module type (description,
  config fields with key/type/description/required/default/options, inputs,
  outputs, example snippet)
- get_step_schema: returns step type info (description, config keys with types
  and descriptions via stepTypeInfoFull, plugin, example snippet)
- get_template_functions: returns all available pipeline template functions with
  name, signature, description, and example (uuid/uuidv4/now/lower/default/
  trimPrefix/trimSuffix/json/step/trigger)
- validate_template_expressions: parses a YAML config, walks pipeline step
  configs for {{ }} expressions, and emits warnings for forward references,
  self-references, undefined step references, and hyphenated dot-access patterns
- get_config_examples: lists .yaml files from the example/ directory or returns
  a specific example's content by name

All five tools are covered by tests in mcp/tools_test.go (63 tests total, all pass).
golangci-lint clean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 27, 2026 15:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds five IDE-support tools to the MCP server to improve the developer experience when authoring workflow YAML configurations. The tools provide schema information, template function documentation, template validation, and access to example configurations.

Changes:

  • Adds get_module_schema, get_step_schema, get_template_functions, validate_template_expressions, and get_config_examples tools
  • Provides comprehensive schema information including config fields, types, descriptions, and examples
  • Implements template expression validation with checks for forward references, undefined steps, and syntax issues
  • Includes 30 tests covering happy paths and error cases for all new tools

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 11 comments.

File Description
mcp/tools.go Implements 5 new MCP tools with schema retrieval, validation, and documentation capabilities (951 lines)
mcp/tools_test.go Comprehensive test suite covering all new tools with 30 test cases (788 lines)
mcp/server.go Registers the new tools in the MCP server initialization
Comments suppressed due to low confidence (2)

mcp/tools_test.go:302

  • The test checks for 8 expected functions but the actual implementation has 10 functions (missing trimPrefix and trimSuffix from the expected list). While the test will still pass since it only checks that the listed functions exist, it should verify all functions are present for complete coverage. Consider adding "trimPrefix" and "trimSuffix" to the expectedFunctions list.
	expectedFunctions := []string{"uuid", "uuidv4", "now", "lower", "default", "json", "step", "trigger"}
	for _, expected := range expectedFunctions {
		if !funcNames[expected] {
			t.Errorf("expected function %q not found in list", expected)
		}
	}

mcp/tools_test.go:572

  • File permission mode 0640 is inconsistent with the project pattern. In server_test.go line 835, test plugins use 0640, but directories use 0750. For consistency, consider using 0600 for files requiring restrictive permissions or 0644 for readable files.
		if err := os.WriteFile(dir+"/"+f, []byte("# test example\nmodules: []\n"), 0640); err != nil {

- Issues 1-3: confirmed false positives — helpers are defined in server_test.go (same package)
- Issue 4: track warnedRefs set to avoid duplicate hyphen warnings for refs already covered by forward/undefined-reference checks
- Issue 5: compile self-reference regex once per step, outside the expression loop
- Issue 6: validate pluginDir follows expected data/plugins layout before deriving exampleDir
- Issue 7: accumulate YAML marshal/unmarshal errors as warnings instead of silently skipping
- Issue 8: add path traversal protection in readExampleFile (reject .., path separators, validate resolved path within exampleDir)
- Issue 9: update hyphen warning message to say the engine auto-corrects it
- Issue 10: change template regex to (?s)\{\{.*?\}\} (non-greedy dotall) with heuristic comment
- Issue 11: remove "(default: 200)" from status field description since it is Required: true

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@intel352 intel352 merged commit b0078e4 into main Feb 27, 2026
14 checks passed
@intel352 intel352 deleted the worktree-agent-a7d337ee branch February 27, 2026 15:48
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.

2 participants