This is the documentation for the v2 beta — looking for the v1 documentation?
Skip to content

MCP TypeScript SDK (V2) / @modelcontextprotocol/codemod / migrations/v1-to-v2/mappings/schemaRouting

migrations/v1-to-v2/mappings/schemaRouting

Functions

isSharedSchemaConst()

isSharedSchemaConst(name, mapping): boolean

Defined in: migrations/v1-to-v2/mappings/schemaRouting.ts:19

True when name (after renames) is a Zod schema CONSTANT that core re-exports — either a spec schema (SPEC_SCHEMA_NAMES) or an OAuth/OpenID schema (AUTH_SCHEMA_NAMES). Membership (not a *Schema suffix) is what keeps TYPES whose name ends in Schema — e.g. BooleanSchema — out.

Parameters

name

string

mapping

ImportMapping

Returns

boolean


removedSymbolGuidance()

removedSymbolGuidance(name, mapping): string | undefined

Defined in: migrations/v1-to-v2/mappings/schemaRouting.ts:47

Guidance for a symbol from this module that has no v2 export anywhere (it must be dropped/flagged rather than routed), or undefined when the symbol routes normally. Shared by the static-import, re-export, mock, and dynamic-import rewrites so all four treat such symbols the same way.

Parameters

name

string

mapping

ImportMapping

Returns

string | undefined


resolveRenamedName()

resolveRenamedName(name, mapping): string

Defined in: migrations/v1-to-v2/mappings/schemaRouting.ts:10

The v2 name a symbol resolves to after renames (per-mapping override, then global SIMPLE_RENAMES).

Parameters

name

string

mapping

ImportMapping

Returns

string


symbolTargetOverride()

symbolTargetOverride(name, mapping): string | undefined

Defined in: migrations/v1-to-v2/mappings/schemaRouting.ts:31

The per-symbol target package for a symbol imported/re-exported/mocked from mapping's module, or undefined when the symbol should use the mapping's resolved target. Exact-name symbolTargetOverrides win over schemaSymbolTarget, which routes a symbol to the shared-schemas package only when its rename-resolved name is a schema constant re-exported by core (see isSharedSchemaConst).

Parameters

name

string

mapping

ImportMapping

Returns

string | undefined