Skip to content

MCP schema materialization removes nested properties named description #1900

Open

Description

@bokelley

In adcp Python 9.6.1, MCP schema materialization drops a nested property whose name is description, and leaves its object closed with additionalProperties: false. A valid response then fails MCP client validation.

Repro

from adcp.validation import get_mcp_schema  # import path as in 9.6.1

schema = get_mcp_schema("list_products", "sync", version="3.2")
props = schema["$defs"]["external:core/canonical-product.json"]["properties"]
assert "description" in props  # fails

The bundled _schemas/3.2/core/canonical-product.json has properties.description: {type: string}.

End to end: a seller's list_products response with products[0].description fails MCP client output validation with Additional properties are not allowed ('description' was unexpected). adcp.validation.validate_response(..., version="3.2") accepts the same response.

Expected

Annotation stripping keeps a property literally named description, with its schema, in every nested properties map, and the object stays closed.

Cause

In adcp/validation/schema_loader.py, lines 1191–1230, _strip_schema_annotations treats the keys of a nested properties map as annotation keywords when preserve_direct_properties=False, so description is removed. Materialization calls it before the compact transform, so both the compact and the defs schema modes are affected.

Impact

Any MCP-served tool whose output objects carry a description property and are closed has the same problem. We hit it implementing list_products for the compact lifecycle, and are working around it locally for that one tool.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions