Skip to content

[Bug]: Invalid JSON Schema - daa_workflow_create 'steps' array missing 'items' property #182

@VoidLight00

Description

@VoidLight00

Bug Description

The daa_workflow_create MCP tool has an invalid JSON Schema definition that causes errors when used with Claude models. The steps property is defined as an array but is missing the required items property.

Error Message

Invalid schema for function 'ruv-swarm_daa_workflow_create': In context=('properties', 'steps'), array schema missing items.

Root Cause

In ruv-swarm/npm/src/mcp-daa-tools.js, the inputSchema for daa_workflow_create is:

{
  name: 'daa_workflow_create',
  description: 'Create an autonomous workflow with DAA coordination',
  inputSchema: {
    type: 'object',
    properties: {
      id: { type: 'string', description: 'Workflow ID' },
      name: { type: 'string', description: 'Workflow name' },
      steps: { type: 'array', description: 'Workflow steps' },  // ❌ Missing 'items'
      dependencies: { type: 'object', description: 'Step dependencies' },
      strategy: { type: 'string', enum: ['parallel', 'sequential', 'adaptive'], description: 'Execution strategy' },
    },
    required: ['id', 'name'],
  },
},

The steps property is missing the items definition, which is required by JSON Schema Draft 2020-12.

Expected Fix

steps: { type: 'array', items: { type: 'object' }, description: 'Workflow steps' },

Note: The correct schema already exists in schemas.js:

steps: {
  type: 'array',
  items: {
    type: 'object',
  },
  required: false,
},

But it's not being used in the actual MCP tool inputSchema.

Reference

Other tools in the same file correctly define items for arrays:

// daa_workflow_execute - correct
agentIds: { type: 'array', items: { type: 'string' }, description: 'Agent IDs to use' },

Environment

  • ruv-swarm version: 1.0.20
  • opencode version: 1.1.36
  • oh-my-opencode version: 3.2.1
  • OS: macOS

Related Issues

  • This is similar to the JSON Schema compliance issues discussed in oh-my-opencode#1183
  • Claude's API strictly enforces JSON Schema Draft 2020-12 validation

Workaround

Disable ruv-swarm MCP server in opencode configuration:

{
  "mcp": {
    "ruv-swarm": {
      "enabled": false
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions