Skip to content

VMCP composite tool parameters should use standard JSON Schema format #2650

@JAORMX

Description

@JAORMX

Problem

Virtual MCP Server composite tool definitions currently use a non-standard simplified parameter format in YAML configuration, which diverges from the MCP specification and creates confusion.

Current Behavior

The YAML configuration expects a simplified format:

composite_tools:
  - name: "my_tool"
    parameters:
      param1:
        type: "string"
        default: "value"
      param2:
        type: "integer"
        default: 42

This is then transformed by pkg/vmcp/config/yaml_loader.go:516-531 into full JSON Schema format before being passed to the workflow engine.

Expected Behavior (MCP Standard)

According to the MCP specification, tool inputSchema should be standard JSON Schema:

{
  "type": "object",
  "properties": {
    "param1": {"type": "string", "default": "value"},
    "param2": {"type": "integer", "default": 42}
  },
  "required": ["param2"]
}

The YAML equivalent should be:

composite_tools:
  - name: "my_tool"
    parameters:
      type: object
      properties:
        param1:
          type: string
          default: "value"
        param2:
          type: integer
          default: 42
      required: ["param2"]

Why This Matters

  1. Non-standard: The simplified format is not documented in any standard (MCP spec, JSON Schema spec, etc.)
  2. Confusion: Users familiar with JSON Schema will be surprised by the format
  3. Limited expressiveness: Cannot specify required fields, additionalProperties, validation constraints, etc.
  4. Inconsistency: The proposal doc THV-2106-virtual-mcp-server.md:442-443 shows JSON Schema format, but the implementation doesn't support it
  5. Transformation overhead: Unnecessary conversion layer in yaml_loader.go

Evidence

Proposal doc (THV-2106-virtual-mcp-server.md:442-443):

parameters:
  pr_number: {type: "integer"}

WorkflowDefinition (pkg/vmcp/composer/composer.go:49):

Parameters map[string]any  // Expects full JSON Schema

YAML Loader (pkg/vmcp/config/yaml_loader.go:161):

Parameters  map[string]map[string]any  // Forces simplified format

Transformer (pkg/vmcp/server/workflow_converter.go:50-68):

// Manually builds JSON Schema from simplified format
params = map[string]any{
    "type":       "object",
    "properties": properties,
}

Proposed Solution

  1. Change yaml_loader.go:161 to accept full JSON Schema:

    Parameters  map[string]any `yaml:"parameters"`  // Accept full JSON Schema
  2. Remove transformation code in workflow_converter.go:50-68 - just pass through

  3. Add validation that parameters is valid JSON Schema (has type: object, properties, etc.)

  4. Update demo configs and docs to show standard JSON Schema format

Workaround

For now, use the simplified format as shown in demo-vmcp-composite-minimal.yaml:28-32:

parameters:
  base_url:
    type: "string"
    description: "Base URL"
    default: "https://example.com"

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiItems related to the APIenhancementNew feature or requestgoPull requests that update go code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions