- refactor types.py into dir
- grokability for LLMs
- better typing in general
lots a goodies #1
expand 2 commits
hide 2 commits
## types architecture
- refactor types.py โ types/ directory structure
- _common.py: RepoIdentifier validation with Annotated types
- _branches.py: branch types + ListBranchesResult.from_api_response()
- _issues.py: issue types + ListIssuesResult.from_api_response()
- __init__.py: public API
- move parsing logic into types via class method constructors
- parsing logic out of tool functions (DRY, separation of concerns)
## issue operations improvements
- return clickable URLs instead of AT Protocol URIs/CIDs
- CreateIssueResult/UpdateIssueResult: {url, issue_id}
- DeleteIssueResult: {issue_id}
- URL generation via @computed_field in types
- RepoIdentifier validator strips @ prefix, normalizes format
- all operations return proper Pydantic models (no dict[str, Any])
## better auth error messages
- _get_authenticated_client() now provides actionable errors
- tells users to verify TANGLED_HANDLE and TANGLED_PASSWORD
## documentation
- wrap MCP client installation in <details> for cleaner README
- add NEXT_STEPS.md documenting critical issues found:
- silent label validation failures (labels must fail loudly)
- missing label data in list_repo_issues
- pydantic field warning
## testing
- add test_types.py with 9 tests covering public API
- validates: RepoIdentifier normalization, URL generation, API parsing
- all 17 tests passing
no breaking changes to public API, all existing functionality preserved
## critical fixes
### 1. fix pydantic field warning
- remove invalid `Field(default=None)` from settings.py
- change to `tangled_pds_url: str | None = None`
### 2. add loud label validation
- new `_validate_labels()` helper checks labels against repo's subscribed definitions
- raises `ValueError` with available labels list when invalid labels provided
- prevents silent failures when creating/updating issues
### 3. include labels in list_repo_issues
- add `labels: list[str]` field to `IssueInfo` model
- fetch and correlate label ops with issues
- return label names (not URIs) for better UX
### 4. add list_repo_labels tool
- new tool to query available labels for a repository
- extracts label names from repo's subscribed label definitions
- helps users discover which labels they can use
## changes
- src/tangled_mcp/settings.py: fix pydantic warning
- src/tangled_mcp/_tangled/_issues.py: add validation, label fetching, new tool
- src/tangled_mcp/types/_issues.py: add labels field to IssueInfo
- src/tangled_mcp/server.py: expose list_repo_labels tool
- src/tangled_mcp/_tangled/__init__.py: export list_repo_labels
- tests/test_server.py: update tool count (5 -> 6)
- README.md: document new tool
all 17 tests passing.
๐ค Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>