Repository navigation
Fix Outlook folder search paging and GoHighLevel contact page size - #1812
Closed
helpcodeai wants to merge 1 commit into
Closed
helpcodeai wants to merge 1 commit into
helpcodeai wants to merge 1 commit into
Conversation
outlook_list_messages mapped $skip next to $search, and Microsoft Graph refuses the two together (SearchWithSkip). Add skip_token mapped to $skiptoken, as outlook_search_messages already does, and say in the skip and search descriptions that a search pages with skip_token. gohighlevel_search_contacts sent no pageLimit when the caller left page_limit out, and HighLevel answers 422 "pageLimit must be a number". Give page_limit a JSON-Schema default of 20 (what its description already promised); the tool call fills schema defaults before the REST engine builds the body. The spec runs the engine path to prove it.
7 of 14 tasks
Contributor
Author
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Two catalog adapter fixes, both found in production tool-call errors.
outlook_list_messages: the tool maps both$searchand$skip. Microsoft Graph refuses$skiptogether with$search(SearchWithSkip), so a model that pages a folder search the way the oldskipdescription told it to fails every time.outlook_search_messagesalready solved this with askip_tokenparameter;outlook_list_messagesnow does the same.gohighlevel_search_contacts: when the caller leavespage_limitout, the body has nopageLimit, and HighLevel answers 422pageLimit must be a number. The description already promised "default 20", but nothing sent it.page_limitnow carries a JSON-Schema"default": 20.Changes
intl/microsoft-outlook.json,outlook_list_messages: new optionalskip_tokenstring mapped to$skiptoken. Theskipdescription now uses the same wording asoutlook_search_messages("Only with filter or no search: ... Outlook refuses skip together with search: use skip_token there."). Thesearchdescriptions of both tools now say "Page it with skip_token, not skip.", and the instructions' pagination paragraph names both tools.intl/gohighlevel.json,gohighlevel_search_contacts:page_limitgets"default": 20.intl/microsoft-outlook.live.spec.tschecks that a folder search pages with$skiptokenand never sends$skip. It also checks that every Outlook tool that maps both$searchand$skipmaps$skiptokenand says so in its descriptions.intl/gohighlevel.live.spec.tsrunsgohighlevel_search_contactsthrough the realRestEngine(axios mocked), filling schema defaults withapplySchemaDefaultsthe wayDynamicMcpTools.executeTooldoes. It asserts the body is{ locationId, query, pageLimit: 20 }whenpage_limitis omitted, and that a caller's own value wins.Why a schema
defaultworks hereDynamicMcpTools.executeTool(mcp-server/dynamic-mcp-tools.ts) and the dashboard Run test (connectors/connectors.service.ts) both callapplySchemaDefaults(common/schema-defaults.util.ts) before the REST engine builds the request. That function fills thedefaultof every top-level parameter that isundefined. Without a value, the REST engine drops a$argbody key, which explains the old emptypageLimit. With the default, the key is filled before mapping. I ran the new spec with the default removed: it fails (body withoutpageLimit). With the default in place, it passes.Other GoHighLevel tools checked
I compared every GoHighLevel parameter whose description mentions a default against the upstream OpenAPI (
GoHighLevel/highlevel-api-docs,apps/*.json). None has the same bug: on every other endpoint,limit/offsetare optional upstream and have a server default. The two endpoints where they are required (GET /invoices/and the social posts list) already carry schema defaults. Not changed here, but worth noting: the descriptions ofgohighlevel_list_orders,gohighlevel_list_transactionsandgohighlevel_list_subscriptionssay "(default 20)", while the upstream default forlimitis 10. That is a wording mismatch, not a failing call.Effect on installed connectors (Cloud and self-hosted alike)
Both changes are safe-class for the catalog re-sync (
connectors/catalog-resync.service.ts):parameterschanged, so the change is safe.endpointMappingonly gains one query key,$skiptoken: "$skip_token", a plain$argwhose parameter is optional and has nodefault.additiveQueryParamsclassifies that as safe: a call withoutskip_tokensends exactly the request it sent before. The description, parameter and instruction changes are safe as well.CatalogReconcilerapplies the safe class automatically at boot to every catalog-installed connector, on Cloud and self-hosted alike, unless a self-hoster setCATALOG_AUTOSYNC=false. In that case "Apply update" on the connector applies it. The adapter version is content-addressed at runtime (computeAdapterVersion), socatalog.tsneeded no change (regenerate-catalog.mjsproduced no diff).Type
Testing
All commands below ran on this branch. Repository root:
npm ci. Inpackages/backend:DATABASE_URL=postgresql://x:x@localhost:5433/x npx prisma generate.node scripts/validate-adapters.mjs --warnmain(1435 existing warnings; the two files add none). The Outlooktool-prefixwarnings (outlook_vsmicrosoft_outlook_) were already there.node scripts/regenerate-catalog.mjscatalog.tsnode scripts/adapter-count.mjs --checkOK: every quoted count equals 957 adapters (51 keyless, 19991 tools).packages/backendnpx jest --maxWorkers=4 src/adapters/intl/microsoft-outlook.live.spec.ts src/adapters/intl/gohighlevel.live.spec.tsRUN_OUTLOOK_LIVE/RUN_GOHIGHLEVEL_LIVE)packages/backend"default": 20removedpackages/backendnpx jest --maxWorkers=4 --silent 'src/adapters/[^/]+\.spec\.ts$' src/connectors/catalog- src/common/schema-defaultspackages/backendnpx tsc --noEmit -p tsconfig.jsonpackages/backendnpx eslint src/adapters/intl/gohighlevel.live.spec.ts src/adapters/intl/microsoft-outlook.live.spec.tsnpm run lint, because its--fixrewrites unrelated files.I did not run the full backend
npm test: about 940 adapter specs fall outside this change. The suites I ran are the catalog-wide specs plus the two adapters.Checklist
npm test): only the targeted suites listed above were runRelated Issues
None filed; found in production tool-call error logs.