different-ai/openwork · error · EnterpriseMcpCatalogError

MCP_CATALOG_ITEM_LIMIT

MCP_CATALOG_ITEM_LIMIT

Error message

MCP_CATALOG_ITEM_LIMIT

What it means

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

Source

Thrown at packages/enterprise-mcp-client/src/resource-catalog.ts:49

async function collectPages<T extends { uri?: string; uriTemplate?: string }>(input: {
  listPage: (cursor: string | undefined, options: RequestOptions) => Promise<{
    items: T[]
    nextCursor?: string
  }>
  requestOptions: RequestOptions
}): Promise<T[]> {
  const items: T[] = []
  const identifiers = new Set<string>()
  const cursors = new Set<string>()
  let cursor: string | undefined
  let catalogBytes = 0

  for (let page = 0; page < ENTERPRISE_MCP_RESOURCE_PAGE_LIMIT; page += 1) {
    const result = await input.listPage(cursor, input.requestOptions)
    for (const item of result.items) {
      if (items.length >= ENTERPRISE_MCP_RESOURCE_ITEM_LIMIT) {
        throw new EnterpriseMcpCatalogError("MCP_CATALOG_ITEM_LIMIT")
      }
      const identifier = item.uri ?? item.uriTemplate ?? ""
      if (identifiers.has(identifier)) throw new EnterpriseMcpCatalogError("MCP_CATALOG_DUPLICATE_RESOURCE")
      const bytes = assertDescriptor(item)
      if (catalogBytes + bytes > ENTERPRISE_MCP_RESOURCE_CATALOG_LIMIT_BYTES) {
        throw new EnterpriseMcpCatalogError("MCP_CATALOG_BYTE_LIMIT")
      }
      catalogBytes += bytes
      identifiers.add(identifier)
      items.push(item)
    }

    if (!result.nextCursor) return items
    if (Buffer.byteLength(result.nextCursor, "utf8") > ENTERPRISE_MCP_RESOURCE_URI_LIMIT_BYTES) {
      throw new EnterpriseMcpCatalogError("MCP_CATALOG_CURSOR_SIZE_LIMIT")
    }
    if (cursors.has(result.nextCursor)) throw new EnterpriseMcpCatalogError("MCP_CATALOG_CURSOR_LOOP")
    cursors.add(result.nextCursor)

View on GitHub (pinned to 2b7df46e8a)

When it happens

Trigger: Thrown at packages/enterprise-mcp-client/src/resource-catalog.ts:49 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/8947e95b69248330. Report an issue: GitHub.