Skip to content

feat(mcp): add list and get tools for annotation layers and annotations#17

Open
hbrooks wants to merge 6 commits into
masterfrom
demo/pr-40342
Open

feat(mcp): add list and get tools for annotation layers and annotations#17
hbrooks wants to merge 6 commits into
masterfrom
demo/pr-40342

Conversation

@hbrooks

@hbrooks hbrooks commented May 28, 2026

Copy link
Copy Markdown

aminghadersohi and others added 6 commits May 21, 2026 20:10
- Use ModelGetInfoCore in get_annotation_layer_info (DRY, matches other get_info tools)
- Expand search_columns to include descr and long_descr (align with docstrings)
- Simplify layer_id assignment in list_layer_annotations (direct attribute set vs rebuild)
- Fix AnnotationList.layer_id default to 0 (ModelListCore cannot inject domain fields)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- AnnotationList.filters_applied used list[AnnotationFilter] which only
  allows col="short_descr", but ModelListCore injects a col="layer_id"
  ColumnOperator that fails Pydantic validation, causing KeyError on
  layer_id in the JSON response. Changed to list[ColumnOperator].
- test_get_annotation_layer_info_found: ModelGetInfoCore._find_object
  calls find_by_id(id, query_options=None), not find_by_id(id); updated
  assertion to assert_called_once_with(5, query_options=None).
Verify that returned annotations carry the expected layer_id, not just
the response header. Fixes the case where a DAO filter failure would
pass the old test undetected.
…tation tools

Re-raise in list_layer_annotations exception handler to match the
list_annotation_layers pattern and avoid swallowing middleware errors.
Removes unused datetime/timezone imports. Strengthens the layer isolation
test to explicitly verify layer_id=2 annotations are excluded.
…tation columns

- Remove parentheses from @pytest.mark.asyncio and @pytest.fixture to
  match project style (PT023/PT001 compliance)
- Add layer_id to DEFAULT_ANNOTATION_COLUMNS so it is always loaded from
  the database when listing annotations within a layer
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