Skip to content

feat(mcp): add list and get tools for CSS templates and themes#16

Open
hbrooks wants to merge 7 commits into
masterfrom
demo/pr-40343
Open

feat(mcp): add list and get tools for CSS templates and themes#16
hbrooks wants to merge 7 commits into
masterfrom
demo/pr-40343

Conversation

@hbrooks

@hbrooks hbrooks commented May 28, 2026

Copy link
Copy Markdown

aminghadersohi and others added 7 commits May 21, 2026 21:14
Co-Authored-By: kasiazjc <kasiazjc@users.noreply.github.com>
… CSS templates and themes

- Remove dead _humanize_timestamp helper from css_template/schemas.py and
  theme/schemas.py (never called; database/schemas.py has the canonical copy)
- Add uuid field to CssTemplateInfo and serialize_css_template_object
  (CssTemplate inherits UUIDMixin)
- Add uuid to CSS_TEMPLATE_DEFAULT_COLUMNS alongside theme's existing uuid
- Register css_template and theme in get_schema tool so LLMs can discover
  column/filter/sort metadata for both new domains

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… and theme

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… for new model types

- Add is_system, is_system_default, is_system_dark to ThemeInfo and
  serialize_theme_object so schema discovery columns are fully serializable
- Add get_schema tests covering css_template and theme model types:
  default column assertions, search/sort columns, and request validation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pip install --upgrade uv downloads uv as a source distribution when no
pre-built wheel matches the platform (python:3.11-slim-trixie), then
fails to compile because cc is absent in the slim image. Using
COPY --from=ghcr.io/astral-sh/uv:latest ships a statically-linked
binary that works on any Linux regardless of glibc version, which is
the approach uv's own documentation recommends for Dockerfiles.
… in tests

FastMCP stores error payloads as JSON in content[0].text, not result.data.
Fixes test_get_theme_info_not_found and test_get_css_template_info_not_found
to match the pattern used consistently across all other MCP tool tests.
- Add UUID test for get_css_template_info with DAO call assertion
- Assert DAO called with id_column="uuid" in get_theme_info UUID test
- Add filter_columns_override to ModelGetSchemaCore to restrict advertised
  filters to the exact set the list tool accepts (fixes schema/API contract mismatch)
- Define CSS_TEMPLATE_FILTER_COLUMNS and THEME_FILTER_COLUMNS constants
- Use overrides in get_schema so css_template and theme only advertise
  template_name/theme_name as filterable (matching ListCssTemplatesRequest
  and ListThemesRequest validation)
- Update get_schema tests to verify filter restriction without DAO mocks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants