Skip to content

Deduplicate record types when objects_as_records is enabled. #126

Description

@victornicolet

Category

MCP Schema Generation

Describe the feature you'd like to request

The deduplicate_entity_types option currently allows de-duplicating enum entity types and leaf object entity types, but doesn't support record types which are emitted with the objects_as_records option.

Problem

When deduplicate_entity_types is true and objects_as_records is also true, leaf record objects are encoded as common types (records) rather than entity types. The current code explicitly strips LeafRecord fingerprints from the resolved dedup map in this configuration:

// LeafRecord dedup only applies when objects are encoded as entity types
if self.config.objects_as_records {
    resolved.retain(|fp, _| !matches!(fp, EntityTypeFingerprint::LeafRecord { .. }));
}

This means two tools with structurally identical objects (same name, same fields, same types, same required status) each get their own duplicate common type definition in their respective Input namespaces, with no consolidation. We should enable deduplication even when objects_as_records is true, following the same logic as the existing deduplication functionality.

Describe alternatives you've considered

We could have a separate option deduplicate-record-types that is separate from the current deduplication option.

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions