Skip to content

Add limit to contacts_search and maps_search - #358

Merged
mattt merged 2 commits into
mattt:mainfrom
oliverames:fix/search-limits
Nov 20, 2026
Merged

mattt merged 2 commits into
mattt:mainfrom
oliverames:fix/search-limits

Conversation

@oliverames

@oliverames oliverames commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

contacts_search and maps_search take no limit, so a client asking for three results can get dozens. contacts_list and maps_explore already have one. This adds the same option to the two search tools.

What changed

  • contacts_search takes an optional limit. With no limit it returns every match, as before.
  • maps_search takes an optional limit, defaulting to the existing defaultSearchLimit of 10.
  • Two files change: App/Services/Contacts.swift and App/Services/Maps.swift.

Testing

  • The iMCP scheme builds and the full imcp-serverTests suite passes.
  • CI: both jobs (macOS 26 with Xcode 26.0, macOS 27 with Xcode 27.0) pass.
  • No new unit tests were added for the limit argument.

Not verified: I have no recorded live call of either tool with a limit through a client on a Mac.

@oliverames
oliverames marked this pull request as ready for review November 18, 2026 11:38
@mattt

mattt commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Following up from #364: in contacts_search, please apply the limit after dropping contacts that can't be converted, the way contacts_list does. For maps_search, let's default to 30, to match Mail, Messages, and Phone.

@oliverames

Copy link
Copy Markdown
Contributor Author

Updated both: contacts_search now applies limit after dropping contacts that can't be converted, and maps_search defaults to 30. Ready for another look.

@mattt
mattt merged commit 75b723e into mattt:main Nov 20, 2026
2 checks passed
@oliverames
oliverames deleted the fix/search-limits branch November 20, 2026 21:34
oliverames pushed a commit to oliverames/iMCP that referenced this pull request Nov 20, 2026
# Conflicts:
#	App/Services/Notes.swift
#	iMCP.xcodeproj/project.pbxproj
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