color_tools.mcp.models

Structured input and output models for the Color Tools MCP server.

class color_tools.mcp.models.CVDResult(*, operation, deficiency, original, transformed, delta_e_2000)[source]

Bases: MCPModel

A color vision deficiency simulation or correction.

Parameters:
operation: Literal['simulate', 'correct']
deficiency: Literal['protanopia', 'protan', 'deuteranopia', 'deutan', 'tritanopia', 'tritan', 'all']
original: ColorCoordinates
transformed: ColorCoordinates
delta_e_2000: float
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class color_tools.mcp.models.ColorAnalysis(*, coordinates, generated_name, name_match_type, in_srgb_gamut, nearest_named_colors, nearest_filaments)[source]

Bases: MCPModel

Comprehensive analysis of one sRGB color.

Parameters:
coordinates: ColorCoordinates
generated_name: str
name_match_type: Literal['exact', 'near', 'generated']
in_srgb_gamut: bool
nearest_named_colors: list[NamedColorMatch]
nearest_filaments: list[FilamentMatch]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class color_tools.mcp.models.ColorComparison(*, first, second, delta_e_2000, delta_e_94, delta_e_76, delta_e_cmc_2_1, hyab, rgb_euclidean)[source]

Bases: MCPModel

Color differences computed with all library distance metrics.

Parameters:
first: ColorCoordinates
second: ColorCoordinates
delta_e_2000: float
delta_e_94: float
delta_e_76: float
delta_e_cmc_2_1: float
hyab: float
rgb_euclidean: float
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class color_tools.mcp.models.ColorCoordinates(*, rgb, hex, xyz, lab, lch, hsl, cmy, cmyk, winhsl240, winhsl255)[source]

Bases: MCPModel

A color represented in every space supported by Color Tools.

Parameters:
rgb: tuple[int, int, int]
hex: str
xyz: tuple[float, float, float]
lab: tuple[float, float, float]
lch: tuple[float, float, float]
hsl: tuple[float, float, float]
cmy: tuple[float, float, float]
cmyk: tuple[float, float, float, float]
winhsl240: tuple[int, int, int]
winhsl255: tuple[int, int, int]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class color_tools.mcp.models.ColorNameValidation(*, is_match, name_match, name_confidence, hex_value, suggested_hex, delta_e_2000, message)[source]

Bases: MCPModel

Validation of whether a supplied name describes a hex color.

Parameters:
  • is_match (bool)

  • name_match (str | None)

  • name_confidence (float)

  • hex_value (str)

  • suggested_hex (str | None)

  • delta_e_2000 (float)

  • message (str)

is_match: bool
name_match: str | None
name_confidence: float
hex_value: str
suggested_hex: str | None
delta_e_2000: float
message: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class color_tools.mcp.models.ConversionResult(*, source_space, source_value, target_space, target_value, in_srgb_gamut, rgb_was_clamped)[source]

Bases: MCPModel

Result of converting a color between supported color spaces.

Parameters:
  • source_space (Literal['rgb', 'xyz', 'lab', 'lch', 'hsl', 'cmy', 'cmyk'])

  • source_value (list[float])

  • target_space (Literal['rgb', 'xyz', 'lab', 'lch', 'hsl', 'cmy', 'cmyk'])

  • target_value (list[float | int])

  • in_srgb_gamut (bool | None)

  • rgb_was_clamped (bool)

source_space: Literal['rgb', 'xyz', 'lab', 'lch', 'hsl', 'cmy', 'cmyk']
source_value: list[float]
target_space: Literal['rgb', 'xyz', 'lab', 'lch', 'hsl', 'cmy', 'cmyk']
target_value: list[float | int]
in_srgb_gamut: bool | None
rgb_was_clamped: bool
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class color_tools.mcp.models.FilamentCatalog(*, record_count, owned_record_count, makers, materials, finishes)[source]

Bases: MCPModel

Discoverable facets of the bundled filament database.

Parameters:
record_count: int
owned_record_count: int
makers: list[str]
materials: list[str]
finishes: list[str]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class color_tools.mcp.models.FilamentMatch(*, id, maker, material, finish, color, hex, effective_hex, rgb_components, rgb, lab, td_value, other_names, distance, metric, source)[source]

Bases: MCPModel

A filament record and its perceptual distance from a target color.

Parameters:
id: str
maker: str
material: str
finish: str | None
color: str
hex: str
effective_hex: str
rgb_components: tuple[tuple[int, int, int], ...]
rgb: tuple[int, int, int]
lab: tuple[float, float, float]
td_value: float | None
other_names: list[str]
distance: float
metric: str
source: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class color_tools.mcp.models.FilamentSearchResult(*, target, metric, searched_owned_only, matches)[source]

Bases: MCPModel

Nearest filament colors after applying catalog filters.

Parameters:
target: ColorCoordinates
metric: Literal['de2000', 'de94', 'de76', 'cmc', 'hyab']
searched_owned_only: bool
matches: list[FilamentMatch]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class color_tools.mcp.models.GamutMappingResult(*, original_lab, was_in_gamut, mapped_lab, mapped_rgb, mapped_hex, delta_e_2000)[source]

Bases: MCPModel

An sRGB gamut check and optional chroma-preserving mapping.

Parameters:
original_lab: tuple[float, float, float]
was_in_gamut: bool
mapped_lab: tuple[float, float, float]
mapped_rgb: tuple[int, int, int]
mapped_hex: str
delta_e_2000: float
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class color_tools.mcp.models.MCPModel[source]

Bases: BaseModel

Base model with immutable values and strict unknown-field handling.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class color_tools.mcp.models.NamedColorMatch(*, name, hex, rgb, lab, lch, distance, metric, source)[source]

Bases: MCPModel

A named palette color and its distance from the requested color.

Parameters:
name: str
hex: str
rgb: tuple[int, int, int]
lab: tuple[float, float, float]
lch: tuple[float, float, float]
distance: float
metric: str
source: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class color_tools.mcp.models.NamedColorSearchResult(*, target, palette, metric, matches)[source]

Bases: MCPModel

Nearest named colors from a requested palette.

Parameters:
target: ColorCoordinates
palette: str
metric: Literal['de2000', 'de94', 'de76', 'cmc', 'hyab']
matches: list[NamedColorMatch]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].