feat: return contact relations and omit binary vCard payloads - #4
Open
janbaer wants to merge 2 commits into
Open
feat: return contact relations and omit binary vCard payloads#4janbaer wants to merge 2 commits into
janbaer wants to merge 2 commits into
Conversation
get-contact echoed the stored vCard verbatim. A card holding an inline
portrait carries PHOTO;ENCODING=b with tens of thousands of base64
characters; on one real card that was 57 KB of a 60 KB result. For an MCP
client this is context spent on bytes no model can use, and it can push a
single tool result past the response limit. Embedded binary values (PHOTO,
LOGO, SOUND, KEY) are now reported as a size marker instead. A photo
referenced by URI is untouched.
Relations are surfaced as a `relations` object keyed by role, e.g.
{"Spouse": "Ada Lovelace"}. Clients record them as a pair sharing a property
group - itemN.X-ABLABEL carries the role, itemN.X-ABRELATEDNAMES the person,
with the role wrapped in Apple's _$!<...>!$_ form - which every caller would
otherwise have to reassemble from raw vCard text.
janbaer
marked this pull request as draft
August 16, 2026 15:39
`relations` mapped a role to a single name, so a card recording two children under the same label kept only the last one and dropped the other without any signal. Children, siblings and friends are exactly the roles that repeat, so this is the ordinary case rather than a contrived one. Each role now carries a list, and a person reached twice — as X-SPOUSE and an item pair usually do — is recorded once. Also spells out in the tool description that the returned vCard is normalised rather than byte-for-byte, so nobody mistakes it for the stored copy.
Author
|
Pushed one follow-up: Also spelled out in the tool description that the returned |
janbaer
marked this pull request as ready for review
August 16, 2026 15:50
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.
Two changes to what
get-contactreturns.Binary payloads. The stored vCard was echoed verbatim. A card with an inline portrait carries
PHOTO;ENCODING=bwith tens of thousands of base64 characters; on one real card that was 57 KB of a 60 KB result, and the tool result exceeded my client's response limit.PHOTO,LOGO,SOUNDandKEYare now reported as<57312 bytes omitted>. A photo referenced by URI is left alone.Relations. Added a
relationsobject keyed by role, e.g.{"Spouse": "Ada Lovelace"}. Clients store these as a pair sharing a property group (itemN.X-ABLABELholds the role,itemN.X-ABRELATEDNAMESthe person, the role wrapped in Apple's_$!<...>!$_form), which every caller would otherwise reassemble from raw vCard text.Four unit tests added, README tool docs regenerated.