Skip to content

Request schemas should use additionalProperties: false #2191

@bokelley

Description

@bokelley

Problem

Request schemas use additionalProperties: true (or omit it, defaulting to true). This causes json-schema-to-typescript to generate index signatures ({ [k: string]: unknown }) alongside named properties, producing TypeScript intersection types. When converted to Zod, these become ZodIntersection which loses .shape — breaking server.tool(name, schema.shape, handler).

We work around this with post-processing (postProcessRecordIntersections) but the root cause is in the schemas.

Proposal

Set additionalProperties: false on all request schemas. Agents send structured tool calls — there's no reason to accept arbitrary keys. Response schemas can remain open (agents may return platform-specific fields).

Discovered during createAdcpServer implementation (adcontextprotocol/adcp-client#541).

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