Repository navigation
Contacts: read and write postal addresses (vCard ADR) - #13
Merged
Merged
Conversation
contacts_read returns `addresses`, contacts_create / contacts_update take it, as a list of objects mapping 1:1 onto the seven ADR components (po_box;extended;street;city;region;postal_code;country) plus type and preferred. Same semantics as emails/phones: the list replaces, [] clears, omitted leaves the card alone. Object form only; contacts_search unchanged. The CardDAV provider writes the params in the dialect the card already speaks (TYPE=HOME,PREF on 3.0, TYPE=home;PREF=1 on 4.0), reads both, leaves every property it does not model in place, and now echoes the REPORT's ETag as If-Match on PUT and DELETE so an update cannot overwrite what another client saved in between. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q9DRvTe1KGW48cAw3CXgvr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
contacts_readreturnsaddresses;contacts_create/contacts_updatetake it. One address is an object mapping 1:1 onto vCard's sevenADRcomponents:Same semantics as
emails/phones: the list replaces,[]clears, omitted leaves the card alone. Object form only (no flat-string shorthand).contacts_searchis unchanged on purpose.How
providers/protocol.py:ContactAddressdataclass,ContactDetail.addresses(default[]),addresseskwarg oncreate_contact/update_contact.providers/soverin/contacts.py: readsADRfrom 3.0 and 4.0 cards (TYPE=HOME,PREF/TYPE=home;PREF=1), writes in the dialect the card already speaks, drops a 3.0LABELwhen replacing the ADRs it described.vobjecthandles;,\escaping. Update stays read-modify-write on the whole card, soPHOTO,CATEGORIES,X-*,NOTEsurvive.getetag; it is now carried through_find_cardand sent asIf-Matchon PUT and DELETE. A 412 becomes a clear "changed on the server, read it again".schemas.py/tools/contacts.py:ContactAddressOutis both the output shape and the input argument, so the MCP schema names every field with a description. An address with nothing filled in is refused.knowledge.py/CLAUDE.md: documented.Tests
tests/test_contacts_addresses.py: 3.0 and 4.0 parsing with two addresses, round-trip withoutaddresses(PUT body equals the parsed card, all unknown properties present), comma + semicolon escaping,[]clears, create, If-Match echoed and 412 surfaced, object-only tool argument.If-Match→ 412.make lintandmake testgreen (248 passed).Acceptance still open
scripts/e2e_contact_address.py <uid>runs the Soverin acceptance (writes the Hoogstraat address onto the contact, verifies emails/phones/note unchanged). Needs.envwith the Soverin credentials andSQUIRREL_CARDDAV_URL; not available in this session.Note: the admin package's Graph contacts provider does not accept
addressesyet, so bumpingSQUIRREL_MCP_REFpast this needs that first (issue filed there).🤖 Generated with Claude Code
https://claude.ai/code/session_01Q9DRvTe1KGW48cAw3CXgvr
Generated by Claude Code