different-ai/openwork · error · EnterpriseMcpCatalogError

MCP_CATALOG_SCHEMA_CYCLE

MCP_CATALOG_SCHEMA_CYCLE

Error message

MCP_CATALOG_SCHEMA_CYCLE

What it means

Error "MCP_CATALOG_SCHEMA_CYCLE" thrown in different-ai/openwork.

Source

Thrown at packages/enterprise-mcp-client/src/tool-catalog.ts:61

    if (!frame) break
    if (frame.leaving) {
      active.delete(frame.leaving)
      continue
    }
    maxDepth = Math.max(maxDepth, frame.depth)
    if (typeof frame.value !== "object" || frame.value === null) continue
    if (active.has(frame.value)) return { bytes: 0, depth: maxDepth, cyclic: true }
    active.add(frame.value)
    stack.push({ value: null, depth: frame.depth, leaving: frame.value })
    const children = Array.isArray(frame.value) ? frame.value : Object.values(frame.value)
    for (const child of children) stack.push({ value: child, depth: frame.depth + 1 })
  }
  return { bytes: serializedBytes(value), depth: maxDepth, cyclic: false }
}

function assertSchema(schema: unknown): void {
  const measurement = measureSchema(schema)
  if (measurement.cyclic) throw new EnterpriseMcpCatalogError("MCP_CATALOG_SCHEMA_CYCLE")
  if (measurement.depth > ENTERPRISE_MCP_TOOL_SCHEMA_DEPTH_LIMIT) {
    throw new EnterpriseMcpCatalogError("MCP_CATALOG_SCHEMA_DEPTH_LIMIT")
  }
  if (measurement.bytes > ENTERPRISE_MCP_TOOL_SCHEMA_LIMIT_BYTES) {
    throw new EnterpriseMcpCatalogError("MCP_CATALOG_SCHEMA_SIZE_LIMIT")
  }
}

function assertTool(tool: EnterpriseMcpTool): void {
  assertStringLimit(tool.name, ENTERPRISE_MCP_TOOL_NAME_LIMIT_BYTES, "MCP_CATALOG_TOOL_NAME_LIMIT")
  assertStringLimit(tool.title, ENTERPRISE_MCP_TOOL_TITLE_LIMIT_BYTES, "MCP_CATALOG_TOOL_TITLE_LIMIT")
  assertStringLimit(tool.description, ENTERPRISE_MCP_TOOL_DESCRIPTION_LIMIT_BYTES, "MCP_CATALOG_TOOL_DESCRIPTION_LIMIT")
  assertSchema(tool.inputSchema)
  if (tool.outputSchema) assertSchema(tool.outputSchema)
}

export async function collectEnterpriseMcpTools(input: {
  listPage: (cursor: string | undefined, options: RequestOptions) => Promise<ToolPage>

View on GitHub (pinned to 2b7df46e8a)

When it happens

Trigger: Thrown at packages/enterprise-mcp-client/src/tool-catalog.ts:61 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/d1a80165cdabdf80. Report an issue: GitHub.